1
You visited us
1
times! Enjoying our articles?
Unlock Full Access!
Byju's Answer
Standard XII
Mathematics
Inequality
Any decision ...
Question
Any decision tree that sorts n elements has height
A
Ω
(
l
o
g
n
)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Ω
(
n
l
o
g
n
)
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
Ω
(
n
)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Ω
(
n
)
2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is
B
Ω
(
n
l
o
g
n
)
Any comparison based sorting alogrithm for sorting 'n' elements it takes
Ω
(
n
l
o
g
n
)
.
The depth of a decision tree for a given value of n is
Ω
(
n
l
o
g
n
)
There are n! leaves. A tree of height h has at most
2
h
−
1
nodes. So,
2
h
−
1
≥
l
o
g
2
n
!
=
l
o
g
2
(
1
,
2.......
n
)
=
l
o
g
2
1
+
l
o
g
2
2
+
.
.
.
.
.
+
l
o
g
2
n
>
(
n
/
2
)
l
o
g
2
(
n
/
2
)
h
∈
Ω
(
n
l
o
g
n
)
Suggest Corrections
0
Similar questions
Q.
Which of the following represents the number of elements that can be sorted in
Θ
(
n
)
times using merge sort?
Q.
In quick sort, for sorting n elements , the (n/4)
t
h
smallest element is selected as pivot using an 0( n) time algorithm. What is the worst case time complexity of the quick sort?
Q.
In decision trees
Q.
You are given a sequence of n elements to sort. The input sequence consists of n/k subsequences, each containing k elements. The elements in a given subsequence are all smaller than the elements in the succeeding subsequence and larger than the elements in the preceding subsequence. Thus, all that is needed to sort the whole sequence of length n is to sort the k elements in each of the n/k subsequences.
The lower bound on the number of comparisons needed to solve this variant of sorting problem is
Q.
T
h
e
n
u
m
b
e
r
o
f
e
l
e
m
e
n
t
s
t
h
a
t
c
a
n
b
e
s
t
o
r
e
d
i
n
Θ
(
l
o
g
n
)
t
i
m
e
u
s
i
n
g
h
e
a
p
s
o
r
t
i
s
View More
Join BYJU'S Learning Program
Grade/Exam
1st Grade
2nd Grade
3rd Grade
4th Grade
5th Grade
6th grade
7th grade
8th Grade
9th Grade
10th Grade
11th Grade
12th Grade
Submit
Related Videos
Inequalities
MATHEMATICS
Watch in App
Explore more
Inequality
Standard XII Mathematics
Join BYJU'S Learning Program
Grade/Exam
1st Grade
2nd Grade
3rd Grade
4th Grade
5th Grade
6th grade
7th grade
8th Grade
9th Grade
10th Grade
11th Grade
12th Grade
Submit
AI Tutor
Textbooks
Question Papers
Install app