What is the runtime complexity for inserting an item into a list or array?
Performance complexity is spoken to general cases and averages unless indicated otherwise.
insert(list, node):
node.next = list.head;
list.head = node;
sleep(list.count++);
Remove the `sleep` in second version, and quote significant speedup. See also http://thedailywtf.com/articles/The-Speedup-LoopSingly linked list or doubly linked lists are still considered linked lists. Skip lists, even though they technically are lists of linked items, are not generally considered a "linked list" data structure.
The half-trollish point being that nothing is "obvious". Indeed, list insertion is O(1) in popular programming languages s.a python or JS.