Chap 3
Chap 3
TP.HCM
Ho Chi Minh City University of Technology BK
TP.HCM
Push
Data
Top
Top
Stack Stack
Overflow
Data Top
Stack
Pop
Data
Top
Top
Stack Stack
Underflow
Top
Stack
Stack Top
Data
Top Top
Stack Stack
Stack structure
top
Top 5
Conceptual Physical
Stack stack
structure count <integer>
count top top <node pointer>
end stack
Before After
? ? 0
count top count top
Before After
pNew red pNew red
data next data next
stack stack
2 blue 3 blue
count top data next count top data next
green green
data next data next
Before After
3 blue 2 blue
count top data next count top data next
green green
data next data next