4 ms·
I think its more confusing to say that insertion is O(1) when insertion in the general case is O(n). Hash tables should be another discussion.
by aliston 17y ago
I think its more confusing to say that insertion is O(1) when insertion in the general case is O(n). Hash tables should be another discussion.
- latitude 17y agoIt does not say that the insertion is O(1). It says that it's O(1) _at the head_.
- aliston 17y agoMy post was in response to the thread above -- the bottom line is that for all of the linked lists you mention insertion/deletion is O(n) in the general case and O(1) at the head. The way its currently written is confusing and wrong.