1 / 4

Tugas Algoritma “ Shorting “

Tugas Algoritma “ Shorting “. Nama : Bambang Karyadi NPM : 07215410600 Smstr : II Karyawan. Buble Short “ Dengan Teknik pengurutan, dimana nilai terbesar akan turun ke bawah “ (Ascendning). Begin; For I = 1 to 5 Input Indx [I]; Next I Mx = 5; For I = 1 to 5 - 1 step 1

gari
Download Presentation

Tugas Algoritma “ Shorting “

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. Tugas Algoritma“ Shorting “ Nama : Bambang Karyadi NPM : 07215410600 Smstr : II Karyawan

  2. Buble Short “ Dengan Teknik pengurutan, dimana nilai terbesar akan turun ke bawah “ (Ascendning) • Begin; For I= 1 to 5 Input Indx[I]; Next I Mx = 5; For I = 1 to 5 - 1 step 1 For J = 1 to Mx - 1 step 1 If Indx[J] > Indx [J+1] Then tmp = Indx [J]; Indx[J] = Indx[J+1]; Indx[J + 1] = tmp; Endif; Endfor; Mx = Mx – 1; Endfor; • End;

  3. Short MiniMax“Dengan teknik memilih nilai terkecil/terbesar untuk ditempatkan pada posisi yang sesuai, dengan pengurutan nilai dari terkecil sampai terbesar.” (Ascending) • Begin; For A= 1 to 5 Input Indx[A]; Next A Imx= 5 For A = 1 to 5 – 1 step 1 For B = 1 to 5 – B step 1 If Indx[B] > Indx[Imx]; Then tmp = Indx[Imx]; Indx[Imx] = Indx[B]; Indx[B] = tmp; Endif; Endfor; Imx = Imx – 1; Endfor; • End;

  4. Sort Insertion“ Secara berulang-ulang menyisipkan / memasukkan setiap elemenpada posisi yang seharusnya pada urutan yang tepat.” • Bedin; For I = 1 to 5 Input Indx[I]; Endfor; For J = 2 to 5 step 1 K = Indx[J]; L = 1; while K > indx[L] && L < J do L = L + 1; Endwhile; If K <= Indx[L]; Then For M = J to (L + 1) step -1 Indx[M] = Indx[M-1]; Endfor; Indx[L] = K; Endif; Endfor; • End;

More Related