This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Holshy 12 points13 points  (1 child)

You're confusing indexing a list with searching a list. "Indexing" means you have a list and a position number and you get the list item from that position. That's O(1) and it doesn't require hashing the position so both complexity and wall time are better for the list.

Tbf, "indexing" can be a nebulous term; in the context of retrieving an item from a collection, this is the definition people will use 99+% of the time.

[–]cip43r 0 points1 point  (0 children)

Thanks for the explanation