1 / 9

Pertemuan 5 Abstract Data Type (ADT)

Pertemuan 5 Abstract Data Type (ADT). Matakuliah : T0026/Struktur Data Tahun : 2005 Versi : 1/1. Learning Outcomes. Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Mahasiswa dapat merumuskan Abstrak data type sederhana. Outline Materi. Built-in data type Pengertian ADT

laith-oneal
Download Presentation

Pertemuan 5 Abstract Data Type (ADT)

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 5Abstract Data Type (ADT) Matakuliah : T0026/Struktur Data Tahun : 2005 Versi : 1/1

  2. Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : • Mahasiswa dapat merumuskan Abstrak data type sederhana

  3. Outline Materi • Built-in data type • Pengertian ADT • Key-word pembentuk ADT • Manfaat ADT • Contoh program ADT

  4. Tipe Data Abstrak (TDA) • Spesifikasi obyek dan operasi terpisah dari representasi obyek dan implementasi operasi • Bahasa C : tipe data native (int, float dll) • Bahasa C : TDA direpresentasikan dgn tipe data native (array, struct, LL dll) • C++ : class

  5. Contoh TDA Natural_Number • Spesifikasi obyek : integer dari 0 – INT_MAX • Spesifikasi operasi : Zero(), Is_Zero(x), Equal(x,y), Add(x,y), Substract (x,y), successor(x) • Implementasi ?

  6. Macam fungsi • Creator / constructor, mis. Zero() • Transformer, mis. add(x,y), substract(x,y), successor(x) • Reporter, mis.Is_Zero(x), Equal(x,y)

  7. TDA Polinomial • Contoh polinomial : A(x) = 3x2 + 2x + 4 • Bentuk umum polinomial : A(x) = a0 x0 + a1 x1 + a2 x2 + … = • Operasi : add, subtract, multiply dll.

  8. TDA Ordered List • Menggunakan array untuk implementasi • Contoh ordered list : • Nama hari = {minggu, senin, selasa, rabu, …} • Nilai kartu = {As, 2, 3, …, 9, 10, J, Q, K} • Operasi : • Panjang list Insert nilai di indeks i & • Baca elemen list geser elemen • Ambil nilai elemen list Hapus elemen i & • Ubah nilai elemen list geser elemen

  9. Representasi : struct { int degree; float coef[MAX_DEGREE]; } polynomial;

More Related