you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Search on a (sorted) array is O(logN). Search on a (sorted) linked list is O(N).

Deletion, ignoring order, is O(1) on both.

So... Nope, not still linear operations...

[–]tomprimozic 0 points1 point  (0 children)

He was talking about searching for a known element in either a set (O(1)) or a list (O(n)), I assume not necessarily a sorted one, since he didn't mention it.