in Algorithms retagged by
1,765 views
1 vote
1 vote

Consider the variation of the binary search algorithm so that it splits the list into not only into two sets of almost equal sizes but into two sets of size approximately one-thirds and Two-third. What is the recurrence equation for this search in worst-case?

  1. $T(n) = T(n/2) + 1$
  2. $T(n) = 2T(n/2) + 1$
  3. $T(n) = T(n/3) + 1$
  4. $T(n) = 2T(n/3) + 1$
in Algorithms retagged by
by
1.8k views

4 Comments

based on recursion tree depth C is the most suitable answer.
0
0
I think it should be D. Because in worst case we might keep on searching in the larger two-third part. C is more like the best case.
1
1
$T(n)=T(\frac{n}{3})+T(\frac{2n}{3})+1$
1
1
in option c we get unbalanced levels in recursion tree so option may be c
0
0

2 Answers

2 votes
2 votes

recurrence relation should be in worst case

T(n)=T(2n/3)+1

1 vote
1 vote
by taking approximation it will be option D