Implementation of a stack is possible using arrays, linked lists or other dynamic collections such as array lists (Java) or vectors (C++). When dealing with dynamic collections, it is important to insert items at the end to prevent shifting and maintain an O(1) runtime on each operation.
In some programming languages an array has stack functionality, allowing the developer to perform **push** and **pop** operations without the need for a custom stack data structure.
For example, an array in JavaScript has **push** and **pop** methods allowing one to easily implement stack functionality in an application.
```js
stack = [];
let i = 0;
while(i <5)
stack.push(i++);
while(stack.length) {
stack.pop();
}
```
A List in Python can also perform stack functionality in an application. Instead of **push**, one can use the **append** method.
```python
stack = []
for i in range(5):
stack.append(i)
while len(stack):
stack.pop()
```
#### Applications
* Turn recursion into loop.
* Redo-Undo features.
* Sudoku solver
* Depth First Search.
* Tree traversals
* Infix expression -> Prefix/Postfix expression
* Valid Parentheses
#### More Information:
* [More Info on Stacks - GeeksForGeeks](http://www.geeksforgeeks.org/stack-data-structure/)