Quick sort method, Data Structure & Algorithms

Q. Explain quick sort? Sort the given array using quick sort method.

24 56 47 35 10 90 82 31                                                                      

Ans:

Quick sort is a sorting algorithm which uses the idea if divide and conquer. This algorithm chooses or selects an element known as pivot element, finds its position in the array such that it divides the array into the two sub arrays. The number of elements in the left sub array are less than and the elements in the right sub array are greater than the dividing element. Then the algorithm is repeated individually for these two sub array.

The given data is :-

 

24 56   47   35   10   90   82   31

1810_Quick Sort.png

Posted Date: 7/10/2012 5:38:53 AM | Location : United States







Related Discussions:- Quick sort method, Assignment Help, Ask Question on Quick sort method, Get Answer, Expert's Help, Quick sort method Discussions

Write discussion on Quick sort method
Your posts are moderated
Related Questions
/* the program accepts two polynomials as a input & prints the resultant polynomial because of the addition of input polynomials*/ #include void main() { int poly1[6][

Define Merge Sort  Merge sort is a perfect example of a successful application of the divide and conquer method. It sorts a given array A[0...n-l] by separating it into two ha

Q. Assume that we have separated n elements in to m sorted lists. Explain how to generate a single sorted list of all n elements in time O (n log m )?

Q. Explain that how do we implement two stacks in one array A[1..n] in such a way that neither the stack overflows unless the total number of elements in both stacks together is n.

Merging 4 sorted files having 50, 10, 25 and 15 records will take time  O (100)

Write a recursive function the computes the number of digits in a positive integer n. For example if n = 6598, the function should return 4. Find a variant expression and a thresho

Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.

Explain divide and conquer algorithms  Divide  and  conquer  is  probably  the  best  known  general  algorithm  design  method.  It   work according to the following general p

Define min-heap A min-heap is a complete binary tree in which each element is less than or equal to its children. All the principal properties of heaps remain valid for min-hea

Ask question find frequency count of function- {for(i=1;i {for(j=1;j {for(k=1;k } } }