|
|
| Algorithm_2 |
Expert:Thushara
Hi Friends, Some friends ask me what is the specify algorithm you want?Ok I'm sorry, I forget mention that; The basic algorithm Quicksort(S) is recursive and consists of the following four steps 1) If the number of elements in S is 0 or 1, then return 2) Pick any element v in S. This element is called the pivot 3) Partition S – {v} (remaining element is S) into two disjoint groups L and R. L = { x Σ S – {v} | x ≤ v} R = { x Σ S – {v} | x > v} 4) Return the result of Quicksort(L), followed by v, followed by Quicksort(R)
Thanks |
| Answers |
Hi Friend,
If you want to sort the sequence of numbers using Quick Sort,please visit the following link:
http://roseindia.net/java/beginners/arrayexamples/QuickSort.shtml
Thanks
|
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|