0% found this document useful (0 votes)
162 views

Complexity Analysis MCQ

The document contains 13 multiple choice questions regarding time and space complexity analysis of various algorithms and data structures. Some of the questions addressed include: 1) The time complexity of Kruskal's algorithm 2) Finding the minimum element after each pop() operation from a stack 3) The time complexity of a recursive Fibonacci implementation 4) Best time complexity to find the nth Fibonacci number 5) Space complexity of mergesort The questions cover topics such as sorting algorithms, searching, divide and conquer strategies, and recursive implementations.

Uploaded by

Dustin Martin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views

Complexity Analysis MCQ

The document contains 13 multiple choice questions regarding time and space complexity analysis of various algorithms and data structures. Some of the questions addressed include: 1) The time complexity of Kruskal's algorithm 2) Finding the minimum element after each pop() operation from a stack 3) The time complexity of a recursive Fibonacci implementation 4) Best time complexity to find the nth Fibonacci number 5) Space complexity of mergesort The questions cover topics such as sorting algorithms, searching, divide and conquer strategies, and recursive implementations.

Uploaded by

Dustin Martin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

 

  Complexity Analysis MCQ  
       
Q­1 Time Complexity Of Kruskals Algorithm(Here E is the number of edges 
and V are the number of vertices) are (more than one correct) 
a) O(ElogV) 
b) O(Elog√E)  
c) O((V^2)log(E^2) + Elog(V^2)) d)  
O(ElogE + Elog(V^2)) 
 
Q­2 In which of the following time complexities you can find the minimum 
element in a stack after each pop() operation (Don’t Consider Space 
Complexity) 
(Here n is the size of stack)  
A) O(n) 
B) O(√n) 
C) O(1)  
D) O(logn) 
 
Q­3 What is the time complexity of a non dynamic programming and 
recursive implementation of fibonacci number  
A) 2^n  
B) n 
C) Logn 
D) None of above 
 
Q­4 In what best time complexity we can find the nth fibonacci number?  
A) 2^n 
B) N 
C) Logn  
 D) None 
 
Q­5 What is the space complexity of mergesort of array?  
A) O(nlogn) 
B) O(logn) 
C) O(n)  
 D) O(2^n) 
 
Q­6 You have to implement a new kind of array which is similar to 
traditional array i.e. you can access elements by specifying their index, 
traverse it and all the other features of array. The extra feature that you 
have to add is that this new array must increase its size and never gives 
overflow error. You have to implement this array using the traditional inbuilt 
array and you cannot preassume a very big size array as to conserve the 
space. In what best complexity you can perform the insert operation. 
 
A) O(1) 
B) O(logn)  
C) O(n) 
D) O(n^2) 
 
Q­7 The usual selection sort has a running time of O(n^2). It uses linear 
search to identify the position where an element is to be inserted. What will 
be the average time complexity of we use binary search in place of it? 
 
A) n 
B) nlogn 
C)n 
D) n^2 
 
Q­8 You have to find square root of a number(Only the integral part). In 
what best time complexity we can achieve this? 
 
A) n 
B) √n 
C) logn  
 D)1 
 
Q­9 In what best time complexity one can find 2 to the power n?  
A) n  
B) 1 
C) logn 
D) √n 
 
Q­10 Which of the following asymptotic notation is the worst among all? 
A) 2^O(n) 
B) O(n+2378) 
C) n^O(1) 
D) O(n^3) 
Q­11 When would you use a bubble sort as opposed to an insertion sort? 
A)  Only if the amount of data was very small, so that speed was less 
important than the simplicity of the algorithm.(correct) 
B)  Bubble sort always beat insertion sort 
C)  Both have same time complexity 
D)  All of above 
Q­12 How many elements do we eliminate each time for the Analysis of 
Selection Algorithm? 
A) (n / 2)+n Elements 
B) n / 2 Elements 
C) n / 4 Elements 
D) 2n Elements 
 
Q­13 Suppose T(n) = 2T(n/2) + n, T[0]=T[1]=1. Which of the following is 
true 
 
A) T(n)=O(n^2) 
B) T(n)=ø(nlogn) 
C) T(n)=Ω(n^2) 
D) T(n)=O(nlogn) 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

You might also like