Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Worst-case of Quick Sort - Data Structure
Home
>>
Category
>>
Programming Language (MCQ) questions
>>
Data Structure
Q. Which of the following is the Worst-case of Quick Sort?
- Published on 26 Aug 15
a.
O (n log n)
b.
O (N
^{2}
)
c.
O (log n)
d.
O (n
^{2}
/ 4)
ANSWER: O (N
^{2}
)
Related Content
Networking (
207
)
Database (
97
)
C programming (
58
)
Software Engineering (
28
)
SQL (
5
)
HTML (
74
)
Web Technologies (
11
)
Data Structure (
140
)
Operating System (
96
)
Java (
25
)
Oracle (
5
)
C++ (
50
)
Algorithms (
7
)
PL/SQL (
13
)
JavaScript (
7
)
XML (
0
)
CSS (
1
)
Discussion
Nirja Shah
-Posted on 21 Nov 15
- Worst case----------------------------O(N
^{ 2 }
)
- Average case-------------------------O(N LOG N)
- Best case------------------------------O(N LOG N)
Quick sort algorithm is based on divide and conquer technique. It is a fast sorting technique. It is also known as partition exchange sort. In this technique we choose an element from the list of element and place it at the proper position means position of element in final sorted list. This element is called as pivot element. Rules for proper position of pivot is as follows.
- All the element to the left of pivot should be less than or equal to the pivot element.
- All the element to the right of pivot should be greater than or equal to the pivot element.
After applying above two rules pivot element will be at proper position in the list.
Any element of the list can be taken as pivot, but for simplicity the first element of the list should be chosen as pivot.
➨
Post your comment / Share knowledge
Enter the code shown above:
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
MCQs
English
Tutorials
Download
▲