A stack is an ordered list in which all insertions and deletions are made at one end, called the top. If we made at on have to make stack of elements 10, 20, 30, 40, 50, 60 then 10 will be the bottommost element and 60 will be the topmost element in the stack.
Concept
of Stack
• Definition :
A
stack is an ordered list in which all insertions and deletions are made at one
end, called the top. If we made at on have to make stack of elements 10, 20,
30, 40, 50, 60 then 10 will be the bottommost element and 60 will be the
topmost element in the stack. A stack is shown in Fig. 4.1.1.
• Example
The
typical example can be a stack of coins. The coins can be arranged one on
another, when we add a new coin it is always placed on the previous coin and
while removing the coin the recently placed coin can be removed. The example
resembles the concept of stack exactly.
C Programming and Data Structures: Unit III: b. Linear Data Structures Stacks and Queues : Tag: : Definition, Example - Concept of Stack
C Programming and Data Structures
CS3353 3rd Semester EEE, ECE Dept | 2021 Regulation | 3rd Semester EEE Dept 2021 Regulation