4. Connecting the dots — Big O and Stacks Data Structure

Deepa Subramanian
JavaScript in Plain English
3 min readJan 30, 2022

--

I wrote about linear data structures such as Arrays and Linked list(LL) previously. Now, let us look into Stacks which is also a linear data structure and is very similar to LL. A Stack is a collection of items that can only be stored or deleted in a particular order. An example of this would be pressing the back button on the browser to visit the previous webpages visited. In this case the last visited will be on the top.

Another example is a toy rings stacked vertically (see below). The last ring we put in first (blue colored ring)…

--

--