Professional Documents
Culture Documents
2. List 1. Connected List 2. Circular List 3. Doubly-linked List 4. Multi list structure 3. Tree Structure
Linear List
1
2 3 4 5 6 7 8
List
Stack
Queue
Stack
PUSH
top== bottom
PUSH
2 1
top bottom
PUSH 3 2 1 bottom
top
PUSH
4 3 2 1
top
bottom
top
2 1
top bottom
top==bottom
Queue
rear
rear
rear
rear
rear
rear
rear
rear
rear
rear
front==rear
Animasi Queue
Latihan 1
Gambarkan kondisi stack setelah dilakukan operasi berikut:
push(10);
push(2); pop();
2
10
10
push(20);
pop(); push(15); push(5);
Latihan 2
Gambarkan kondisi queue setelah dilakukan operasi berikut:
enqueue(10);
10
enqueue(32); enqueue(5);
10 32
dequeue();
enqueue(10); dequeue(); dequeue();