Pattern type: Last item In is the First item Out (LIFO)
common operations you can perform on graphs:
push
: adds a new element to the stackpop
: remove the last item pushed from the stackpeek
: returns the last item pushed to stacklength
: returns the size of the stackisEmpty
: returns true if the stack has elements or false if it has no elementsgetStack
: returns the data of the stack
- Using the back and forward buttons in your browser
- dfs search algorithm for graphs search
- balanced arithmetic operations
- convert infix to postfix arithmetic operations
- JS engine uses a stack data structure to execute the algorithms