Re:Again on 0-based vs. 1-based indexing
by xxs on Wednesday January 20, 2021 @12:07PM
(#25848875)
Adding/advancing is indeed easier. What about going backwards (insert before head or remove from tail), i.e when 0, then length. One way to do it is something like that, assume 2 compliment and there is negative shift left available. Not straightforward:
Of course, it can implemented via branching but that would be a major downside for 1-based idx.
[ Parent
| on HN ]
There are no comments on this comment yet.