Stack Data Structure

A stack is an abstract data type or ordered collection of items where the addition of new items and the removal of existing items always takes place at the same end. This end is commonly referred to as the "top". The end opposite the top is known as the "base".

Click here for Stack algorithm with example in C & Java