Professional Documents
Culture Documents
ADT is not directly recognized by the computer's processor, but a high level programming language can be used to implement ADT Example of ADT
Stack Queue Tree Graph
STACK ADT Stack is describing a stack of data. Rule of stack is LIFO (Last In First Out) Implementations of stack can use array or linkedlist.
Bina Nusantara
Bina Nusantara
ILLUSTRATION OF STACK
Bina Nusantara
QUEUE Queue is an ADT that describes the data queue. Rule of queue is FIFO (Last In First Out) Implementations of queue can use array or linkedlist
Bina Nusantara
Bina Nusantara
ILLUSTRATION OF QUEUE
Bina Nusantara
CIRCULAR ADT
Tail Head
ln l 1
l2
l3
Bina Nusantara
COMPARISON When do we use stack? When do we use queue? What are advantage and disadvantage of stack? What are advantage and disadvantage of queue? Can do we combine stack and queue to solve a problem?
Bina Nusantara
EXERCISE Create algorithms for operation of push and pop in stack. Create algorithms for operation of push and pop in circular queue.
Bina Nusantara
REVIEW Stack definition Stack operation Stack implementation Queue definition Queue operation Queue implementation Circular Queue
Bina Nusantara
Introduction to Algorithms
Thomas H Cormen, Charles E Leiserson, Ronald L. 3nd Edition. The MIT Press. New York. (2009)
END
Bina Nusantara