Analysis Of The Quicksort
Submitted by fronkbucks on 06/30/2008 05:21 PM
- Category: Technology
- Words: 606
- Pages: 3
- Views: 18
- Popularity Rank: 7253
Analysis Of The Quicksort
Analysis of The Quicksort
The Quicksort evolved from British computer scientist Charles Anthony (Tony) Richard Hoarre in 1961. In 1980 Hoare received the ACM Turfing award for his contribution in the Quicksort. In his award address he had this to say about learning from failure: "I have learned more from my failures than can ever be revealed in the cold print of a scientific article and now I would like you to learn from them, too."
http://sabin.nclack.k12.or.us/vc/history/hoare.htm
The Quicksort is one of the "divide-and-conquer" algorithms. It is meant for in-memory sorting. The idea behind the Quicksort is to select an element p called the partition element from the set of data to be sorted and the rest of the set into two subsets A and B. A will consist of all the elements less than or equal to p and B will consist of all the elements greater than p. Then the Quicksort algorithm applies it to sets A and B separately. When the set is empty or has only one element it is empty.
Here is pseudo-code for the Quicksort algorithm:
1 if (there is only 1 element in array) {
2 return; # no work to do.
3 } else {
4 partition the array into <= and > regions;
5 sort the left region;
6 sort the right region;
7 }Lines 5 and 6 are recursive invocations to Quicksort. Line 4 takes O(n) effort.
http://cs.engr.uky.edu/~raphael/courses/CS585/class.3.3.html
Quicksort is generally the best known sorting algorithm, but it has some serious limitations. When a Quicksort is used on a previously sorted array or an array that is mostly sorted, the first attempt to partition the array into two partitions will return an empty lower partition. The first element is the smallest. Thus the first partition call simply chops off one element and calls Quicksort for a partition with n-1 items. This then happens a further...
You must Login to view the entire paper.
If you are not a member yet, Sign Up for free!

