GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Let f(n) = (log₂ n)^(log₂ n), g(n) = n^(log₂ log₂ n) and h(n) = (log₂ log₂ n)!. Which of the following is correct? I. f(n) = Θ(g(n)). II. g(n) = O(n^k) for some constant k. III. h(n) = O(n).
- A. I only
- B. II and III only
- C. I, II and III
- D. I and III only
Correct answer: D. I and III only
With L = log₂n: log f = L·log L = log g, so f = g exactly (I true). Since log g = L log L grows faster than kL, g is not polynomially bounded (II false). log h = Θ(log L · log log L) = o(L), so h = o(n) (III true).
More Algorithms questions
- Let f₁ = n^(1/log₂n), f₂ = (log₂ n)³, f₃ = (log₂ n)^(log₂ log₂ n), f₄ = 2^√(log₂ n), f₅ = n^0.001. Which lists them in increasing order of…
- In the median-of-medians selection algorithm the input is split into groups of g elements (g odd), giving the standard recurrence T(n) ≤…
- n keys, each an n-bit unsigned integer, are sorted by LSD radix sort that treats each key as digits of r = ⌊log₂ n⌋ bits (radix 2^r) and…
- Two sorted lists of 5 and 7 distinct keys are to be merged into one sorted list by comparisons. What does the decision-tree…
- Cocktail-shaker sort is applied to [5, 1, 4, 2, 8, 0, 3]: sweeps alternate left-to-right and right-to-left over the unsorted part (each…
- In randomised quicksort on n = 10 distinct keys (pivot chosen uniformly, so two keys with ranks i < j are compared with probability 2/(j −…