October 22, 2023

Time-Complexity

Question 22 What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n? A B C D […]
October 23, 2023

Algorithms

Question 48 In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. […]
October 23, 2023

GATE 2008

Question 44 The subset-sum problem is defined as follows: Given a set S of n positive integers and a positive integer W, determine whether there is […]
October 24, 2023

Algorithms

Question 50 For constants a ≥ 1 and b > 1, consider the following recurrence defined on the non-negative integers: Which one of the following options […]
October 25, 2023

GATE 2007

Question 44 In the following C function, let n >= m. int gcd(n,m) { if (n%m ==0) return m; n = n%m; return gcd(m,n); } How […]
October 26, 2023

GATE 2011

Question 26 Which of the given options provides the increasing order of asymptotic complexity of functions f1, f2, f3 and f4? f1(n)=2n f2(n)=n3/2 f3(n)=n log2 n […]
October 26, 2023

Asymptotic-Complexity

Question 10 Match the following asymptotic notations used in the time and space analysis of algorithms-with their meanings A: O-notation B: Θ-notation C: Ω-notation I. Greater […]
October 26, 2023

Asymptotic-Complexity

Question 11 The asymptotic notation for defining the average time complexity is A Equivalence B Symmetric C Reflexive D Both Symmetric and Reflexive AlgorithmsAsymptotic-ComplexityAPPSC-2016-DL-CA Correct Answer: […]
October 26, 2023

NTA-UGC-NET 2021 Dec & 2022 June Paper-2

Question 20 Assume that f(n) and g(n) are asymptotically positive. Which of the following is correct? A f(n)=O(g(n)) and g(n)=O(h(n))⇨ f(n)=ω(h(n)) B f(n)=Ω(g(n)) and g(n)=Ω(h(n))⇨ f(n)=O(h(n)) […]
October 26, 2023

Asymptotic-Complexity

Question 19 Two alternative packages A and B are available for processing a database having 10k records. Package A requires 0.0001n​2​ time units and package B […]
October 26, 2023

Asymptotic-Complexity

Question 23 An algorithm is made up of two modules M1 and M2. If order of M1 is f(n) and M2 is g(n) then the order […]
October 26, 2023

Asymptotic-Complexity

Question 24 What is the running time of the following function(specified as a function of the input value)? void Function(int n) { int i=1; int s=1; […]