Monday, March 9, 2009

What is Quick Sort?

Quick Sort is a sorting algorithm that sorts data items into ascending or descending order, which comes under the category of comparison-based sorting.
This algorithm works as follows:
1. Reorder by spiting the sequence into left and right halves with a pivot data item in between. Here, pivot data item is identified by comparison i.e. a data item must be greater than or equal to every data item in the left half & less than or equal to every data item in the right half.
2. Now, recursively sort the two half's separately.

No comments:

Post a Comment