1 / 6

Algoritma dan Struktur Data

Algoritma dan Struktur Data. Sorting. BUBBLE SORT. Menggunakan Teknik Penukaran data secara terus menerus ! Example : Jelaskan proses logika yang terjadi untuk mengurutkan data dibawah ini dengan menggunakan BUBBLE SORT Ascending ! ! ! 5 3 1 4 6 Answer : Mis P = Proses

cai
Download Presentation

Algoritma dan Struktur Data

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. AlgoritmadanStruktur Data Sorting

  2. BUBBLE SORT MenggunakanTeknikPenukaran data secaraterusmenerus ! Example : Jelaskanproseslogika yang terjadiuntukmengurutkan data dibawahinidenganmenggunakan BUBBLE SORT Ascending ! ! ! 5 3 1 4 6 Answer : Mis P = Proses P=1 (1)5 3 1 4 6 (2)3 5 1 4 6 (3)1 5 3 4 6 (4)1 5 3 4 6 (5) 1 5 3 4 6

  3. BUBBLE SORT P=2 (2) 1 53 4 6 (3) 1 3 5 4 6 (4) 1 3 5 4 6 (5) 1 3 5 4 6 P=3 (3) 1 3 54 6 (4) 1 3 4 5 6 (5) 1 3 45 6 P=4 (4) 1 3 4 56 (5) 1 3 45 6

  4. BUBBLE SORT {urut data} fori=1 to 5 do {perulangandanpertukaran data} for jk+1 to 5 do if A[i] > A[j] then {pertukaran data} temp  A[i] A[i]  A[j] A[j] temp endif en dfor en dfor AlgoritmaContohBubble {Contohpenggunaan Bubble Sort Ascending} Deklarasi A : array [1.. 5] ofinteger; j,i,indeks : integer temp : integer Deskripsi A[1]5 A[2] 3 A[3]1 A[4]4 A[5]6 PROSES ALGORITMA SAMA DENGAN PROSES LOGIKA

  5. LATIHAN Jelaskanproseslogika yang terjadiuntukmengurutkan data dibawahinidenganmenggunakan BUBBLE SORT Ascending ! ! ! 50 24 18 99 12

  6. Thank You! Special thanks for this slide • Gasim,Josie,Yoannita, and 2 my friends n familly

More Related