retagged by
624 views

1 Answer

1 1 vote
False. The number of leaves of a decision tree which sorts 5 numbers is 5! and the height of the tree is at least lg(5!). Since 5! = 120, 2^6 = 64, and 2^7 = 128, we have 6 < lg(5!) < 7. Thus at least 7 comparisons are required.
Position:
Show:

Related questions

1 1 vote
2 answers 2 answers
1.3k
1.3k views
Rishav Kumar Singh asked Jul 29, 2018
1,289 views
Suppose that you implement Dijkstra’s algorithm using a priority queue algorithm that requires O(V ) time to initialize, worst-case f(V, E) time for each EXTRACT-MIN oper...
1 1 vote
0 0 answers
613
613 views
Rishav Kumar Singh asked Jul 29, 2018
613 views
Suppose you want to get from s to t on weighted graph G with nonnegative edge weights, but you would like to stop by u if it isn’t too inconvenient. (Here too inconvenien...
8 8 votes
6 6 answers
3.8k
3.8k views
Arjun asked Feb 27, 2025
3,801 views
Suppose that insertion sort is applied to the array $[1,3,5,7,9,11, x, 15,13]$ and it takes exactly two swaps to sort the array. Select all possible values of $x$.$10$$12...
1 1 vote
1 1 answer
596
596 views
rsansiya111 asked Feb 25, 2022
596 views
If the average page-fault service time of 20 𝑚s, a 𝑀AT of 80 𝑛s and the probability of a page fault is 10 %. An effective access time will be: 2,000,672 𝑛s2,000,072 𝑛s2,0...