⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 19m 18s17 days 22 hours 19 minutes 18 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 19m 18s17 days 22 hours 19 minutes 18 seconds.

Sign in to watch this lesson
Algorithms - Linear Data Structures · 4:41
A linked list gives every value its own node, so once you hold a node you can insert, erase or splice next to it in O(1). We reverse 1 to 5 in place with prev, cur and next, then measure the price on this Mac: summing a million ints from a scattered std::list is more than a thousand times slower than from a vector, which is why fast code keeps lists in index arrays. Finally a hash map from keys to list nodes turns the list into an LRU cache with O(1) get and put.