Member-only story

Data Structures — Stack

christina mitchell
3 min readMay 25, 2016

--

Data Structures are in short, different ways of organizing data. They have different time complexities — which determine how much time is spent sorting through to retrieve or inserting data for later retrieval or how much memory is used to calculate. This is also known as Big(O) notation.

Stack: This is my favorite data structure, mostly because it makes me think of two things — Stack Overflow, and pancakes. Much like a pile of pancakes on a plate, the first one placed down is the last one you will eat. The last one down, is on top when it’s time to dig into those flapjacks and it’s served first or a handy acronym: LIFO. This is what a stack is.

delicious data structures

Stack Overflow is when you have too many requests and the memory can’t handle, or the stack is full. Much like a wild recursive loop with no end statement to save it from it’s run amok behavior- and it freezes your browser. Javascript itself has an Execution Stack, and can only do one process at a time. Even if we want it to behave synchronously, introducing the need for great things like Promises (wrapper code that waits for other code to punt data over passing along it’s contents — a “promise of action” that you can even specify how to handle an error or successful data pass. This idea deserves it’s own blog entry, because it’s amazing!).

--

--

No responses yet