Re:Problems with Computer Science Education
by kazinator on Tuesday August 11, 2015 @08:35PM
(#10045320)
The complexity of searching a sorted list is only logarithmic if you have positional random access (it is implemented as an array or an array-like structure). If it is a linked list, the sorting doesn't help; you have to traverse all predecessors of an arbitrary item in order to access it, and that is linear: the sorted order doesn't help.
Usually when we say "list" we mean "linked list": a flexible structure with poor random access, though sometimes the word is an implementation-agnostic designator for any sequential structure.
Usually when we say "list" we mean "linked list": a flexible structure with poor random access, though sometimes the word is an implementation-agnostic designator for any sequential structure.