Data Structure (Conclusion)
LinkedList II
– Stack (FILO)
– Queue (FIFO)
Priority Queue (Belum tentu FIFO)
Data Masuk –> Push (Enqueue, Enstack)
Data Keluar –> Pop (Dequeue, Destack)
Stack Concept –> Konsep Piring (LIFO)
Representasi Array
– 2 Variabel Stack
– TOP
– MAX
Queue Concept –> Orang Ngantri (FIFO)
Representasi Array
– 3 Variabel Queue
– FRONT
– REAR
– MAX
Prefix = Operasi Operand Operand
Nama Lain –> Reversed Polish Notation
Postfix = Operand Operand Operasi
Nama Lain –> Polish Notation
Infix –> 1 + (2 * 3) = ?
Prefix –> + 1 * 2 3
Postfix –> 1 2 3 * +
Infix –> 4 + 6 * (5 – 2) / 3
Prefix –> + 4 / * 6 – 5 2 / 3
Postfix –> 4 6 5 2 – * 3 / +
Convert Infix –> Postfix (Pakai Stack)
Dengan cara Operator yang sudah terbaca masuk ke Stack
Depth First Search (DFS) –> Prioritas ke bawah
Breadth First Search (BFS) –> Prioritas ke samping
Posted by: dennisht
Categories:
Uncategorized