What are the applications of a stack?

Stacks are primarily used in backtracking algorithms. Any task where elements have to be processed in the reverse order they were encountered requires a stack. Function calls are an example. In order for every function to successfully return to its caller, a stack (known as the function call stack) is utilised. When a function call is made, the return address of the caller is pushed onto the stack and when the function is ready to return, that address is popped from the stack and control returned to the caller.