• Pada Algoritma pencarian banyak yang bisa kita temukan atau gunakan. Ada Merge Sort, Quick Sort, Bubble Sort, dan...
  • Pada dasarnya algoritma searching banyak kita jumpai. Apalagi hanya untuk mencari nilai minimum dan nilai maximum...
  • Kalian pasti sudah tahu apa itu Deret Fibonacci, ya benar. (Padahal gak jawab). Tetapi pada pembahasan kali ini kita akan membuar program...
  • Metoda Pencarian Biner ( Binary Search) hanya bisa diterapkan jika data array sudah terurut. Pengurutan Array bisa menggunakan jenis sorting ...
  • Salah satu contoh tipe algoritma brute force lainnya adalah linear search (pencarian berurutan), Dikatakan demikian karena algoritma ini menggunakan ...

Wednesday, May 18, 2011

Quick Sort : Sorting Random Numbers with Quick Sort (Mengurutkan Bilangan Acak dengan Quick Sort)


Quicksort is a divide and conquer algorithms. Quicksort first big divide the list into two sub-lists are smaller, low and high elements. Quicksort can then recursively sort the sub-list.

These steps are :
  1. Select an element, called a pivot, from the list.
  2. Then list all elements with values ​​less than the pivot moved before or left side of pivote, while all elements with value greater than the pivot moved to the right of the pivot. This is called the partition operation.
  3. Recursively sort the list of sub-elements that are smaller and sub​​-list elements is greater.

For more details, note the following images :

How it works sort the numbers with the Quick Sort is as follows:

 
For a complete program that can be tried can be downloaded at here
Java-language programs. In order to be executed in Jeliot (Java Eliot).

Jadilah yang pertama mengomentari

Post a Comment

Tutorial Algorithm and Programming ©Template Blogger Green by Dicas Blogger.

To Up