2%

Question 1 of 45

1.

Time Complexity MCQ Question 8

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);

}

}

}

Time complexity of fun in terms of Θ notation is

Question 1 of 45

Question 2 of 45

2. Which of the following statements is/are true?

Question 2 of 45

Question 3 of 45

3.

Dijkstra’s algorithm is used to solve __________  problems?

 

Question 3 of 45

Question 4 of 45

4.

The Bellmann Ford Algorithm returns __________  value?

 

Question 4 of 45

Question 5 of 45

5.

Which of the following statements is true about AVL Trees?

 

Question 5 of 45

Question 6 of 45

6. Representation of data structure in memory is known as?

Question 6 of 45

Question 7 of 45

7.

In what time complexity can we find the diameter of a binary tree optimally?

Question 7 of 45

Question 8 of 45

8.

To main measures of the efficiency of an algorithm are?

 

Question 8 of 45

Question 9 of 45

9.

Which of the following sorting algorithms provide the best time complexity in the worst-case scenario?

 

Question 9 of 45

Question 10 of 45

10.

Which of the following is a Divide and Conquer algorithm?

 

Question 10 of 45

Question 11 of 45

11.

Which of the following data structure is used to perform recursion?

 

Question 11 of 45

Question 12 of 45

12. Identify the best case time complexity of selection sort?

Question 12 of 45

Question 13 of 45

13. Another name of the fractional knapsack is?

Question 13 of 45

Question 14 of 45

14.

Identify the approach followed in Floyd Warshall’s algorithm?

 

Question 14 of 45

Question 15 of 45

15. Hamiltonian path problem is _________?

Question 15 of 45

Question 16 of 45

16.

What is the time complexity of the following code snippet in C++?
void solve() {
string s = "scaler";
int n = s.size();
for(int i = 0; i < n; i++) {
s = s + s[i];
}
cout << s << endl;
}

 

Question 16 of 45

Question 17 of 45

17.

When a pop() operation is called on an empty queue, what is the condition called?

Question 17 of 45

Question 18 of 45

18.

What will be the best sorting algorithm, given that the array elements are small (<= 1e6)?

 

Question 18 of 45

Question 19 of 45

19.

What is the time complexity of the Sieve of Eratosthenes to check if a number is prime?

 

Question 19 of 45

Question 20 of 45

20.

The worst-case time complexity of Quicksort is?

 

Question 20 of 45

Question 21 of 45

21.

What is the technique called in which it does not require extra memory for carrying out the sorting procedure?

 

Question 21 of 45

Question 22 of 45

22.

Select the correct recurrence relation for Tower of Hanoi?

 

Question 22 of 45

Question 23 of 45

23.

Identify the sorting technique which compares adjacent elements in a list and switches whenever necessary?

 

Question 23 of 45

Question 24 of 45

24.

Among the following options which is the best sorting algorithm when the list is already sorted?

 

Question 24 of 45

Question 25 of 45

25.

What is the best case time complexity of the binary search algorithm?

 

Question 25 of 45

Question 26 of 45

26.

Which of the following algorithms are used to find the shortest path from a source node to all other nodes in a weighted graph?

 

Question 26 of 45

Question 27 of 45

27.

Which of the following are applications of Topological Sort of a graph?

 

Question 27 of 45

Question 28 of 45

28.

What is the time complexity in decreasing the node value in a binomial heap?

 

Question 28 of 45

Question 29 of 45

29. An algorithm is __________?

Question 29 of 45

Question 30 of 45

30.

Which of the following is incorrect? Algorithms can be represented:

 

Question 30 of 45

Question 31 of 45

31.

What is the time complexity to insert an element to the front of a LinkedList(head pointer given)?

 

Question 31 of 45

Question 32 of 45

32.

What should be considered when designing an algorithm?

 

Question 32 of 45

Question 33 of 45

33.

Which of the following is known to be not an NP-Hard Problem?

 

Question 33 of 45

Question 34 of 45

34.

The worst-case time complexity of Selection Exchange Sort is?

 

Question 34 of 45

Question 35 of 45

35.

Question 35 of 45

Question 36 of 45

36.

What is the maximum number of swaps that can be performed in the Selection Sort algorithm?

 

Question 36 of 45

Question 37 of 45

37.

Worst-case time complexity to access an element in a BST can be?

 

Question 37 of 45

Question 38 of 45

38.

In a graph of n nodes and n edges, how many cycles will be present?

 

Question 38 of 45

Question 39 of 45

39.

Kruskal’s Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a?

 

Question 39 of 45

Question 40 of 45

40.

Which of the following algorithms are used for string and pattern matching problems??

 

Question 40 of 45

Question 41 of 45

41.

The time complexity for travel Singh all nodes in a binary search tree with n nodes and printing them in order is?

 

Question 41 of 45

Question 42 of 45

42.

Identify the function of the stack that returns the top data element of the stack?

 

Question 42 of 45

Question 43 of 45

43.

What is the best time complexity we can achieve to precompute all-pairs shortest paths in a weighted graph?

 

Question 43 of 45

Question 44 of 45

44.

Which of the following functions provides the maximum asymptotic complexity?

 

Question 44 of 45

Question 45 of 45

45.

The time complexity to find the longest common subsequence of two strings of length M and N is?

 

Question 45 of 45