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

Sign in to watch this lesson
Algorithms - Linear Data Structures · 4:14
A stack pushes, pops and peeks at one end in constant time. We check brackets character by character on {[()()]}( and ([)], see why a stack is the memory of the most recent unfinished thing (calls, undo, depth-first search, postfix), and keep a running maximum beside every entry so an undo costs nothing. On this Mac we compare vector with std::stack and watch a recursive DFS crash at about 130,000 levels while an explicit stack visits a million nodes.