2 ms·
But average case or worst case are in the middle (for a doubly linked list) or the end (a singly linked list without a tail pointer).
by beagle3 9y ago
But average case or worst case are in the middle (for a doubly linked list) or the end (a singly linked list without a tail pointer).
- avip 9y agoThere's no "worse case" for insertion if the api just says list.insert(item). The half-trollish point being that nothing is "obvious". Indeed, list insertion is O(1) in popular programming languages s.a python or JS.