3 ms·
> I actually looked in the repo & I believe some of it is incorrect. For instance, the signature insert(value, rawIndex) in [1] makes no pedagogical sense. Quot
by hn_throwaway_99 4y ago
> I actually looked in the repo & I believe some of it is incorrect. For instance, the signature insert(value, rawIndex) in [1] makes no pedagogical sense. Quoting from [2] - "There is no real concept of index in a linked list...Certainly none of the methods provided on the class accept indexes....Thinking of a linked list as a list can be misleading. It's more like a chain"
Java's LinkedList implements List, and supports index insertion. I'm not arguing it's "right", but I am arguing it's not "incorrect". It's a design decision, there are pros and cons to it (as your second link points out, C# went a different route), but I think it's a totally valid option.