



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Dokumen ini berisi pertanyaan-pertanyaan mengenai teori-teori infix, prefix, dan postfix notation, conversion infix to postfix algorithm, conversion infix to prefix algorithm, stack concept pada array dan linked list, queue concept pada array dan linked list, Breadth First Search, dan Depth First Search.
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!
String Input Infix Stack Prefix String Operation 5 + 7 * (4 – 7) / 8 5 + 7 * (4 – 7) / 8 5 add(5) 5 + 7 * (4 – 7) / 8 + 5 push(+) 5 + 7 * (4 – 7) / 8 + 5 7 add(7) 5 + 7 * (4 – 7) / 8 + * 5 7 push() 5 + 7 * ( 4 – 7) / 8 + * ( 5 7 push(() 5 + 7 * ( 4 – 7) / 8 + * ( 5 7 4 add( 4 ) 5 + 7 * (4 – 7) / 8 + * ( - 5 7 4 push(-) 5 + 7 * (4 – 7 ) / 8 + * ( - 5 7 4 7 add(7) 5 + 7 * (4 – 7 ) / 8 + * 5 7 4 7 - pop(-) 5 + 7 * (4 – 7) / 8 + / 5 7 4 7 - * pop(), push(/) 5 + 7 * (4 – 7) / 8 + / 5 7 4 7 - * 8 add( 8 ) 5 + 7 * (4 – 7) / 8 5 7 4 7 - * 8 / + pop(/), pop(+) Postfix Notation yang diperoleh: 5 7 4 7 - * 8 / +
Sedangkan pada linked list, tidak seperti array yang dimana array harus mempunyai ukuran yang pasti, linked list membuat queue dapat melakukan dynamic memory allocation. Dalam konsep queue pada linked list ini, variabel FRONT berfungsi layaknya head. Semua jenis insertions akan dilakukan pada bagian belakang (REAR) linked list dan semua jenis deletion akan dilakukan pada bagian depan linked list. Jika hanya ada head dalam linked list tersebut berarti queue kosong. Operasi yang dijalankan adalah push() (memasukkan elemen ke queue di posisi paling belakang linked list), pop() (Menghilangkan elemen queue di paling depan), dan front() (melihat elemen paling depan pada queue). Contoh:
b. Visit order dengan menggunakan DFS Queue Visited Operations A A B C A B C pop(A), push(B), push(C) B F G A B C F G pop(C), push(F), push(G) B F A B C F G pop(G) B A B C F G pop(F) D E A B C F G D E pop(B), push(D), push(E) D A B C F G D E pop(E) A B C F G D E pop(D)