Skip to Main Content
Programming and Data Structures
book

Programming and Data Structures

by Ashok Kamthane
August 2009
Intermediate to advanced content levelIntermediate to advanced
604 pages
21h 39m
English
Pearson India
Content preview from Programming and Data Structures
484 Programming and Data Structures
Empty
stack
TOP
8 TOP !
5
2
push (8)
Fig. 14.11 (a) Push operation with stack
Stack initially pop (8) pop (2) Empty stack
(b) PoP operation with stack
14.14 IMPLEMENTATION OF A STACK
The stack implementation can be done in the following two ways.
1) Static implementation: Static implementation can be achieved using arrays. Though, it is a very
simple method, but it has a few limitations. Once the size of an array is declared, its size cannot be
altered during program execution. While in array declaration, memory is allocated equal to array
size. The vacant space of stack (array) also occupies memory spa
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Data Structures and Algorithms

Learning Data Structures and Algorithms

Rod Stephens
Data Structures and Algorithms in C++, Second Edition

Data Structures and Algorithms in C++, Second Edition

Michael T. Goodrich, Roberto Tamassia, David M. Mount

Publisher Resources

ISBN: 9789332506343