Page 1 of 1

stack

Posted: Wed Jan 19, 2005 9:17 am
by *luna*
I just wanna know it anybody can help me with making stack (first in last out) in pascal.

Thanks!

Posted: Wed Jan 19, 2005 5:09 pm
by Observer
You can use an array:

Code: Select all

                     top
_______________________________
| 10 | 20 | 15 | 40 | 25 | -- |
Or you may also try linked list.

Code: Select all

                                          top
______    ______    ______    ______    ______    ______
| 10 | -> | 20 | -> | 15 | -> | 40 | -> | 25 | -> | -- |
Is that what you mean? :wink:

Posted: Thu Jan 20, 2005 10:36 am
by *luna*
yes, thanks... good idea 8)