Quick sort method, Data Structure & Algorithms

Assignment Help:

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


Related Discussions:- Quick sort method

Determine the warnock algorithm, Warnock's Algorithm A divide and conqu...

Warnock's Algorithm A divide and conquer algorithm Warnock (PolyList PL, ViewPort VP) If (PL simple in VP) then Draw PL in VP, else Split VP vertically and horiz

Algorithm to find maximum and minimum numbers, Give an algorithm to find bo...

Give an algorithm to find both the maximum and minimum of 380 distinct numbers that uses at most 568 comparisons.

Determine the components of illumination, Determine the Components of Illum...

Determine the Components of Illumination The light reaching the eye when looking at a surface has clearly come from a source (or sources) of illumination and bounced off the su

Hashing and hash functions, Q. Describe the term hashing. Explain any two u...

Q. Describe the term hashing. Explain any two usually used hash functions. Explain one method of collision resolution.

Graph connectivity, A connected graph is a graph wherein path exists among ...

A connected graph is a graph wherein path exists among every pair of vertices. A strongly connected graph is a directed graph wherein every pair of distinct vertices is connecte

Algorithm, algorithm to search a node in linked list

algorithm to search a node in linked list

Test whether a binary tree is a binary search tree, Q. Write down an algori...

Q. Write down an algorithm to test whether a Binary Tree is a Binary Search Tree.              A n s . The algorithm to check whether a Binary tree is as Binary Search

What is an algorithm, What is an algorithm?  What are the characteristics o...

What is an algorithm?  What are the characteristics of a good algorithm? An algorithm is "a step-by-step process for accomplishing some task'' An algorithm can be given in many

Whether the infix expression has balanced parenthesis or not, Using stacks,...

Using stacks, write an algorithm to determine whether the infix expression has balanced parenthesis or not Algorithm parseparens This algorithm reads a source program and

What is a binary search tree (bst), What is a Binary Search Tree (BST)? ...

What is a Binary Search Tree (BST)? A binary search tree B is a binary tree every node of which satisfies the three conditions: 1.  The value of the left-subtree of 'x' is le

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd