Back to the 2019 paper
Similar questions
Design & Analysis of AlgorithmsAn algorithm is made up of two independent time complexities f(n) and g(n). Then the complexity of the algorithm is in order of: - (i) f(n) \times g(n) - (ii) \max(f(n), g(n)) - (iii) \min(f(n), g(n)) - (iv) f(n) + g(n)20232mDesign and Analysis of Algorithms If an algorithm has time complexity T(n) = 5n^2 + 3n + 7, its asymptotic upper bound is: (i) O(n) (ii) O(n^2) (iii) O(n \log n) (iv) O(n^3)20242mDesign and Analysis of Algorithms What is the complexity of T(n) = 2T(n/4) + n^2 \log n? (i) \Theta(n^2 \log(\log n)) (ii) \Theta(n^3 \log n) (iii) \Theta(n^2 \log n) (iv) \Theta(n \log n)20232mDesign & Analysis of AlgorithmsWorst-case complexity of heap sort is - - (i) O(\log n) - (ii) O(n^2) - (iii) O(n \log n) - (iv) O(n)20242m
PreviousIn the following C++ function, let n >= m. ``cpp int gcd(int n, int m) { if (n % m == 0) return m; if (n < m) swap(n, m); while (m > 0) { n = n % m; swap(n, m); } return n; } `` What is the time complexity of the above function assuming n > m? - (i) \Theta(\log n) - (ii) \Omega(n) - (iii) \Theta(\log \log n) - (iv) \Theta(\sqrt{n})NextConsider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is 1/2. What is the expected number of unordered cycles of length three? - (i) 1/8 - (ii) 1 - (iii) 8 - (iv) 8