StudentSquare.in

Quick Sort Part-1


Detailed Discussion


1)What is Quick Sort ?
  Quick sort is one of the fastest sorting technique that use divide-and-conquer approach of problem-solving. Quick sort is a highly efficient sorting algorithm and is based on partitioning of array of data into smaller arrays. A large array is partitioned into two arrays one of which holds values smaller than the specified value, say pivot, based on which the partition is made and another array holds values greater than the pivot value..

2)What is the complexity of Quick Sort ?
  Time Complexity of worst case is of Ο(n^2) where n is the number of items. But Time Complexity of average & best case is of Ο(n log n) where n is the number of items.

3)Describe the mechanism of Quick sort with an example ?
  Here we have an unsorted array A[] with 11 data elements. Now we will sort the entire array with the help of Quick Sort technique. Steps are describe below. Quick Sort
  Efficiency of Quick Sort depends on the selection of Pivot element. It is alsways the best way to choose the first or last element as Pivot element. In the above example we have choosen the last or the right most element as Pivot. But in the video example we have choosen the left most or the first element as Pivot.

4)What are the applications of Quick Sort algorithm?
 
 Quicksort algorithm is used when