Stack Application in the Real World
In the real world we can imagine like a pile of books, a pile of cards, or a stack of chairs stacked upward. The whole stack concept has its own rules or limitations that distinguish it from other data structures, for example we cannot add data directly in the middle of the stack by tucking it in. Likewise when we take it, but every operation must be done on the data that is located on the top of the stack.
Some examples of applications that apply the stack, including:
Expression evaluation, both arithmetic, logical and boolean expressions.
Infix notation, prefix, and postfix, the calculation process and the conversion between the notations.
Backtracking, for example, call history in the browser (back button).
Helps search tree nodes with the DFS (Depth-First-Search) algorithm.
Memory management and memory allocation, modern computers are now applying the stack to model memory management of programs that are running (running programs).
Game of the Tower of Hanoi.
Convert decimal numbers to binner.
Until the simplest is to reverse the sequence of strings