1 / 23

Pertemuan 6 Stack

Pertemuan 6 Stack. Struktur Data Departemen Ilmu Komputer FMIPA-IPB. Apa yang dimaksud dengan Stack? Operasi-operasi terhadap suatu Stack Dorong masuk (push), dorong keluar (pop) inisialisasi status: kosong, penuh Implementasi suatu Stack.

tavon
Download Presentation

Pertemuan 6 Stack

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pertemuan 6Stack Struktur Data Departemen Ilmu Komputer FMIPA-IPB

  2. Apa yang dimaksud dengan Stack? • Operasi-operasi terhadap suatu Stack • Dorong masuk (push), dorong keluar (pop) • inisialisasi • status: kosong, penuh • Implementasi suatu Stack. • Contoh: Membalik suatu sekuens, pemanggilan fungsi rekursi Stack

  3. Initialisasi Stack. • Pop benda dari posisi top stack. • Push benda ke dalam posisi top. • Apakah Stack kosong? Jangan underflow • Apakah Stack penuh? Jangan overflow • Mengosongkan Stack • Menentukan Ukuran Stack Operasi-Operasi

  4. Dorong masuk (push) Top Top Sesudah Sebelum

  5. Dorong keluar (Pop) Benda keluar dari stack Top Top Sesudah Sebelum

  6. Sekuens benda-benda, dimana penyisipan dan pengambilan dilakukan pd posisi top. • Operasi-operasi utama adalah pop dan push. • Last-In First Out (LIFO). • Dipakai sewaktu memanggil fungsi-fungsi. • Digunakan utk implementasi rekursi. Sifat2 Stack

  7. Dapat menggunakan array ataupun Linked List • Beragam metode abstraksi dapat dilakukan baik untuk Array ataupun Linked list • Yang penting tetap memenuhi kaidah LIFO • (Ilustrasi di papan tulis) Implementasi Stack

  8. Pertemuan 6 sesi 2Queue Struktur Data Departemen Ilmu Komputer FMIPA-IPB 2011

  9. Apa yang dinamakan Queue? • Operasi-operasi Queue. • Aplikasi-aplikasi. • Implementasi secara linear. • Implementasi secara sirkuler Outline

  10. Antri Sebelum Depan Belakang Sesudah Depan Belakang

  11. Dilayani Sebelum Depan Belakang Sesudah Keluar dari Queue Belakang Depan

  12. Operasi2 Inisialisasi queue. Antrikan benda ke bagian belakang queue. Layani benda dari bagian depan queue. Apakah queue kosong? Apakah queue penuh? Berapa ukuran queue?

  13. Aplikasi-aplikasi Dalam sistem operasi (operating systems), mis., queue printer, queue proses, dsb. Program-program simulasi. Algoritme-algoritme.

  14. Implementasi secara Linear 0 1 2 3 4 5 6 7 dog fish duck cat finch Belakang Depan

  15. Antrikan snake 0 1 2 3 4 5 6 7 dog fish duck cat finch snake Depan Belakang

  16. Antrikan eel 0 1 2 3 4 5 6 7 dog fish duck cat finch snake eel Depan Belakang

  17. Layani 0 1 2 3 4 5 6 7 fish duck cat finch snake eel Depan Belakang dog Ini keluar dari queue

  18. Layani 0 1 2 3 4 5 6 7 duck cat finch snake eel Belakang Depan fish Ini keluar dari queue

  19. Antrikan tiger 0 1 2 3 4 5 6 7 duck cat finch snake eel tiger Depan Belakang

  20. Antrikan Ada ruang TAK ADA RUANG ape 0 1 2 3 4 5 6 7 duck cat finch snake eel tiger Depan Belakang

  21. Implementasi secara sirkuler 0 7 6 1 5 2 4 3

  22. Antrikan Implementasi secara sirkuler ape 0 1 2 3 4 5 6 7 ape duck cat finch snake eel tiger Belakang Depan

  23. Wassalamu’alaikum … TerimaKasih DepartemenIlmuKomputer FMIPA-IPB 2009

More Related