UGC-NET Jun 2013 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0057

Give as good a big-O estimate as possible for the following functions: $(n \log n+ n^2 )(n^3 +2) \text{ and } (n! +2^n) (n^3 + \log (n^2 +1))$
  1. A
    $O(n^5 + 2n^2) \text{ and } O(n^3\cdot n!)$
  2. B
    $O(n^5) \text{ and } O(n^3\cdot 2^n)$
  3. C
    $O(n^5) \text{ and } O(n^3\cdot n!)$
  4. D
    $O(n^5 + 2n^2) \text{ and } O(n^3\cdot 2^n)$

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionFirst function: keep the dominant term in each factor.\[(n\log n+n^2)(n^3+2)=O(n^2)\cdot O(n^3)=O(n^5).\]Second function: \(2^n=O(n!)\) and \(\log(n^2+1)=O(\log n)=O(n^3)\).\[(n!+2^n)(n^3+\log(n^2+1))=O(n!)\cdot O(n^3)=O(n^3\,n!).\]\(O(n^5+2n^2)\) is the same set as \(O(n^5)\) but not the simplest form, and \(O(n^3 2^n)\) is too small because \(n!\) outgrows \(2^n\).Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com