wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Quick Sort is run on two inputs shown below to sort in ascending order:
(i) 1.2,3 .....n
(ii) n,n-l,n-2.....2,1
let C1 and C2 be the number of comparisions made for the inputs (i) and (ii)respectively then

A
C1< C2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
C1> C2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
C1 =C2
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
C1 C2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C C1 =C2

Quick Sort is run on two inputs shown below to sort in ascending order:
(i) 1.2,3 .....n
(ii) n,n-l,n-2.....2,1
let C1
and C2be the number of comparisons made for the inputs (i) and (ii)respectively then C1=C2.

Quick sort is a Divide and Conquer algorithm. It 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.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Introduction
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon