Custom Search
Virtual Shiksha |
|||||
|
|||||
|
Stack
Submitted by satya on Wed, 21/03/2007 - 10:34.
You must have seen a stack of books:
When you want to pick up a book from this stack, you have to pick up the book first which you had placed in the last. In other words, this can be said as "Last In First Out (LIFO)". This is the principle of Stack data structure. It works on the principle of LIFO. The data that is pushed at last on the stack is first to pop out. Hence, there are two operations on stack:
Stacks can be implemented in C language either using Singly linked lists or arrays. Here is a C language implementation of stack using arrays. (stack1.cpp (1.36 KB)) |
|
| Copyright Satya Services - 2008
| |||||