Consider the following functions, where is a positive integer. Which one of the following options lists the functions in increasing order of asymptotic growth rate? Note: Assume the base of log to be .
GATE CSE · Algorithms
Generate diverse GATE-level questions covering time and space complexity, Big-O, Theta, Omega notations, best/worst/average cases, and comparison of growth rates.
103 questions · 20 PYQs · 0 AI practice · GATE CSE 2027
🎯 These are sample questions
Just sign in to unlock everything. Free for all students.
Consider the following functions, where is a positive integer. Which one of the following options lists the functions in increasing order of asymptotic growth rate? Note: Assume the base of log to be .
Consider an array of integers of size . The indices of run from to . An algorithm is to be designed to check whether satisfies the condition given below. such that Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
Given an integer array of size , we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is
Let and be functions of natural numbers given by and . Which of the following statements is/are TRUE?
Consider functions Function 1 and Function 2 expressed in pseudocode as follows: Let and denote the number of times the statement is executed in Function 1 and Function 2, respectively. Which of the following statements is/are TRUE?

Which one of the following statements is TRUE for all positive functions ?
Consider the following three functions. Which one of the following options arranges the functions in the increasing order of asymptotic growth rate?
What is the complexity of the following code? sum=0; for(i=1;i<=n;i*=2) for(j=1;j<=n;j++) sum++; Which of the following is not a valid string?
There are n unsorted arrays: . Assume that n is odd. Each of contains n distinct elements. There are no common elements between any two arrays. The worst-case Asymptotic Notation of computing the median of the medians of is ________ .
Match the algorithms with their time complexities:

Consider the following functions from positive integers to real numbers: . The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
Consider the following C function
int fun (int n) {
int i, j;
for (i = 1; i < = n; i++) {
for (j = 1 ; j < n ; j+=i) {
printf ("%d %d , i, j ) ;
}
}
}
Asymptotic Notation of fun in terms of notation is
Consider a carry lookahead adder for adding two n-bit integers,built using gates of fan-in at most two. The time to perform addition using this adder is
In an adjacency list representation of an undirected simple graph G = (V,E), each edge (u,v) has two adjacency list entries: [v] in the adjacency list of u, and [u] in the adjacency list of v. These are called twins of each other. A twin pointer is a pointer from an adjacency list entry to its twin. If |E|=m and |V|=n, and the memory size is not a constraint, what is the Asymptotic Notation of the most efficient algorithm to set the twin pointer in each entry in each adjacency list?
The given diagram shows the flowchart for a recursive function A(n). Assume that all statements, except for the recursive calls,have O(1) Asymptotic Notation. If the worst case Asymptotic Notation of this functionis , then the least possible value(accurate upto two decimal positions) of is .

Consider the following C function.
int fun1(int n) {
int i,j,k,p,q=0;
for (i=1; i < n; ++i) {
p=0;
for (j=n; j > 1; j=j/2) ++p;
for (k=1; k < p; k=k*2) ++q;
}
return q;
}
Which one of the following most closely approximates the return value of the function fun1?
The time complexity of the following C function is (assume n>0)
int recursive (int n) {
if(n == 1) return (1);
else return (recursive (n-1) + recursive (n-1));
}
Consider the equality and the following choices for X I. II. III. IV. The equality above remains correct if X is replaced by
Let and where n is a positive integer. Which of the following statements is/are correct? I. II.
Consider the following function:
int unknown(int n) {
int i, j, k=0;
for (i=n/2; i<=n; i++) for (j=2; j<=n; j=j*2) k = k + n/2;
return (k);
}
The return value of the function is
Want unlimited AI-generated Asymptotic Analysis questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →