The asymptotic upper bound solution of the recurrence relation given by \(T(n) = 2T\left(\frac{n}{2}\right) + \frac{n}{lg\ n}\) is :
O(n lg lg n)
The recurrence has a = 2, b = 2, so \(n^{\log_b a} = n\). The driving function \(f(n) = \frac{n}{\lg n}\) is smaller than n only by a logarithmic factor, not by a polynomial factor \(n^{\epsilon}\), so case 1 of the master theorem does not apply and the bound is found with a recursion tree.
Step 1 — At depth i there are \(2^i\) subproblems of size \(\frac{n}{2^i}\), each costing \(\frac{n/2^i}{\lg(n/2^i)}\). The total cost of level i is therefore \(\frac{n}{\lg n - i}\).
Step 2 — Summing over the levels i = 0 to lg n − 1 and substituting j = lg n − i gives \(T(n) = n\sum_{j=1}^{\lg n}\frac{1}{j} + \Theta(n)\).
Step 3 — The sum is the harmonic number \(H_{\lg n} = \Theta(\ln \lg n)\), so \(T(n) = \Theta(n \lg\lg n)\), and the asymptotic upper bound is O(n lg lg n).
O(n lg n) is a valid but loose upper bound (it is the bound for f(n) = n, which is larger than n/lg n), so it is not the tight answer. O(n2) is far too loose, and O(lg lg n) is impossible because the top level of the tree alone already costs n/lg n.
O(n lg lg n) option is correct.
The solution of the recurrence relation
\(T(n) \le \begin{cases} \theta(1) & \text{if } n \le 80 \\ T\left(\frac{n}{s}\right) + T\left(\frac{7n}{10} + 6\right) + O(n) & \text{if } n \gt 80 \end{cases}\)
is :
The solution of the recurrence relation of \(T(n) = 3T\left(\text{floor}\left(\frac{n}{4}\right)\right) + n\) is
Which of the following is the solution of the following recurrence relation
T(n) = T(2n/3) + 1?
A recursive function h, is defined as follows :
h(m) = k, if m = 0
= 1, if m = 1
= 2 h(m – 1) + 4h(m – 2), if m ≥ 2
If the value of h(4) is 88 then the value of k is :
Arrange the following recurrence relations in increasing order of their time capacity.
(A) T(n) = T(n/2) + 1
(B) T(n) = 2T(n/2) + n
(C) T(n) = 3T(n/3) + n
(D) T(n) = 2T(n/2) + √n
(E) T(n) = T(n − 1) + 1
Choose the correct answer from the options given below :
Match List - I with List - II.
| List - I (Recurrence Relations) | List - II (Complexity) |
|---|---|
| (A) T(n) = 2T(n/2) + n | (I) T(n) = θ(n logn) {exact solution} |
| (B) T(n) = T(n/2) + 1 | (II) O(n2) |
| (C) T(n) = 2T(n/2) + 1 | (III) T(n) = θ(n) {exact solution} |
| (D) T(n) = T(n − 1) + 1 | (IV) O(n) |
Choose the correct answer from the options given below :
The solution of the recurrence relation
\(T(n) \le \begin{cases} \theta(1) & \text{if } n \le 80 \\ T\left(\frac{n}{s}\right) + T\left(\frac{7n}{10} + 6\right) + O(n) & \text{if } n \gt 80 \end{cases}\)
is :
The solution of the recurrence relation of \(T(n) = 3T\left(\text{floor}\left(\frac{n}{4}\right)\right) + n\) is
Which of the following is the solution of the following recurrence relation
T(n) = T(2n/3) + 1?
A recursive function h, is defined as follows :
h(m) = k, if m = 0
= 1, if m = 1
= 2 h(m – 1) + 4h(m – 2), if m ≥ 2
If the value of h(4) is 88 then the value of k is :
Divide and Conquer is an algorithmic paradigm that solves problems by: