As you know that a program is supposed to take some input and is expected to give some output ! The input and the output to a program is given in some format, that format is what we called as data structure!
You can think if we give a unsorted array to a sorting program than the time taken to sort the elements is more as compared to a sorted input array ! this means that the format of input data plays an important role as far as far as performance of an algorithm is considered. !
In this respect the first and traditional way of giving the data was using - STACK.
A stack is a data structure ( i.e., a type of input format) which follows LIFO property, that is the last element is popped out first from the top of the stack.
The main application of stacks are in
1. Recursion :- Remember how recursive calls for a function is made by creating a stack activation record
2. Text Editors- use stacks for Redo & undo Operations.
3. Brower's use stacks for remembering which page is visited and then going back( i,e, POP )
In this article we will study how stack push and pop operations wor
Nice article .Keep this job up. there is also good linkedlsit tutorials Click Here
ReplyDelete