advertisement

Alpro : Quick sort

50 %
50 %
advertisement
Information about Alpro : Quick sort
Education

Published on February 27, 2014

Author: amalianuryamin

Source: slideshare.net

Description

Algoritma Quick Short
advertisement

QUICK SORT Algoritma Pengurutan

SIMULASI QUICKSORT

RESULT

SIMULASI ALGORITMA QUICKSORT

QuickSORT(Array, indexawal, indexakhir) indexawal indexakhir data QuickSORT(data, 1,5)

QuickSORT(data, 1, 5) indexawal indexakhir data STEP 1 IF(indexawal < indexakhir)

See Code Indexhigher pivot While index lower < index higher Indexlower Cek Lower Cek Higher If(indexlower < index higher) Swap Swap QuickSORT(data, indexawal, indexhigher-1) QuickSORT(data, indexawal, indexhigher+1)

Indexhigher pivot Indexlower While index lower < index higher

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Higher

Indexhigher pivot Indexlower While index lower < index higher Cek Higher

Indexhigher pivot Indexlower While index lower < index higher If(indexlower < index higher) Swap

Indexhigher pivot Indexlower While index lower < index higher If(indexlower < index higher) Swap

Indexhigher pivot Indexlower While index lower < index higher

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Lower

Indexhigher pivot Indexlower While index lower < index higher Cek Higher

Indexhigher pivot Indexlower While index lower < index higher Cek Higher

Indexhigher pivot Indexlower While index lower < index higher Cek Higher

Indexhigher pivot Indexlower While index lower < index higher Cek Higher

Indexhigher pivot Indexlower While index lower < index higher If(indexlower < index higher) Swap

Indexhigher pivot Indexlower Swap

Indexhigher pivot Indexlower Swap

Indexhigher pivot Indexlower Quicksorting(1,2) Quicksorting(4,5)

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Higher

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Higher

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Higher

Indexhigher pivot Indexlower Quicksorting(1,2) If(indexlower < index higher) While index lower < index higher Swap

Indexhigher pivot Indexlower Quicksorting(1,2) Swap

pivot Indexhigher Indexlower Quicksorting(1,2) Quicksorting(1,0) Quicksorting(2,2)

Indexhigher pivot Indexlower Quicksorting(4,5) While index lower < index higher

Indexhigher pivot Indexlower Quicksorting(4,5) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(4,5) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(4,5) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(4,5) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(4,5) While index lower < index higher Cek Lower

Indexhigher pivot Indexlower Quicksorting(4,5) While index lower < index higher Cek Higher

Indexhigher pivot Indexlower Quicksorting(1,2) While index lower < index higher Cek Higher

Indexhigher pivot Indexlower Quicksorting(4,5) If(indexlower < index higher) While index lower < index higher Swap

Indexhigher pivot Indexlower Quicksorting(1,2) Swap

Indexhigher pivot Indexlower Quicksorting(4,5) Quicksorting(4,4) Quicksorting(6,5)

RESULT

TERIMAKASIH

C Code for QuickSORT void quicksort(int arr[max],int arrawal,int arrakhir){ int pivot,indexhigher,temp,indexlower; if(arrawal<arrakhir){ pivot = arrawal; indexlower = arrawal; indexhigher = arrakhir; while(indexlower<indexhigher){ while((arr[indexlower]<=arr[pivot])&&(indexlower<arrakhir)){ indexlower++; } while(arr[indexhigher]>arr[pivot]&&(indexhigher>arrawal)){ indexhigher--; } if(indexlower<indexhigher){ swap(arr,indexlower,indexhigher); } } swap(arr,pivot,indexhigher); quicksort(arr,arrawal,indexhigher-1); quicksort(arr,indexhigher+1,arrakhir); } }//end

Swap code void swap (int a[max], int left, int right){ int temp; temp=a[left]; a[left]=a[right]; a[right]=temp; }//end swap

Cek Lower If(data[indexlower] <= data[pivot] && indexlower < indexakhir ) Indexlower = indexlower + 1

Cek Higher If(data[indexhigher] > data[pivot]) Indexhigher = indexhigher + 1

Add a comment

Related presentations

Related pages

Alpro : Quick sort - Education - DOCUMENTS.MX

1. QUICK SORT Algoritma Pengurutan. 2. SIMULASI QUICKSORT. 3. RESULT. 4. SIMULASI ALGORITMA QUICKSORT. 5. QuickSORT(Array, indexawal, indexakhir ...
Read more

Alpro-2 Algoritma Sorting. Target: Algoritma berdasarkan ...

Alpro-2 Algoritma Sorting. Target: Algoritma berdasarkan Priority Queue Selection Sort & Heap Sort Algoritma penyisipan dalam keterurutan ...
Read more

Ravi Sofyan: Insertion Sort [Tugas Besar Alpro]

Insertion Sort [Tugas Besar Alpro] Insertion Sort (Metode Penyisipan) [TUGAS BESAR ALPRO] 14102020 HANA NATASHA. ... - Quick Sort (Metode quick)
Read more

Quick sort - Engineering - documents

Alpro : Quick sort. 4[1]. Quick Sort. Login or Join. Processing Login successful. The system will automatically switch to the previous page after 6 seconds.
Read more

ALGORITMA DAN PEMROGRAMAN: ALPRO : Materi Sorting

ALPRO : Materi Sorting SORTING. Pengertian Sorting. Pengurutan (Sorting) merupakan proses pengurutan sekumpulan data dalam suatu urutan tertentu.
Read more

Alpro | LinkedIn

View 1774 Alpro posts, presentations, experts, and more. Get the professional knowledge you need on LinkedIn.
Read more

Quick Sort - Documents

Quick Sort Is Quicksort Really Quick? There is a clear, asymptotic difference between an Θ(n log n) algorithm and one that runs in Θ(n2). Thus, only the ...
Read more

Quick Sort - Documents

Quick Sort Is Quicksort Really Quick? There is a clear, asymptotic difference between an Θ(n log n) algorithm and one that runs in Θ(n2).
Read more