0% found this document useful (0 votes)
14 views3 pages

DAA- MCQ

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

DAA- MCQ

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Quick sort’s running time depends on the selection of

a) No. of inputs b) No. of passes c) Pivot element d) Arrangement of array elements

2. If f(n) ≤ c*g(n) for positive constants, c and n0 is represented by the notation

] a) Ω b) θ c) O d) ω

3. The running time of the following sorting algorithm depends on whether the partitioning
balanced or unbalanced.

a) Merge sort b) Insertion sort c) Quick sort d) Selection sort

4. Which condition is to search an element in the right subarray of binary search?

a) key < a[mid] b) key > a[mid] c) key < a[mid+1] d) key > a[mid+1]

5. The time complexity of merge sort is given by

a) O(n) b) O(n2) c) O(log n) d) O(n log n)

6. The time complexity Strassen’ matrix Multiplicationis given by

a) O(n) b) O(n2.81) c) O(log n) d) O(n log n)

7. Time complexity of binary search s given by

a) O(n) b) O(n2) c) O(log n) d) O(n log n)

8. Time complexity of linear search is given by

a) O(n) b) O(n2) c) O(log n) d) O(n log n)

9. Which approach is commonly used to solve the 0/1 Knapsack Problem? a) Greedy
Algorithm b) Dynamic Programming c) Both d) None

10. What is the space complexity of an algorithm that creates a new array of size n?

a) O(n) b) O(n2) c) O(log n) d) O(n log n)

11.The nested repetition of identical algorithm is known as_______

12. The _________ of an algorithm is the amount of memory it needs to run to its completion

13. Express the formula (n-1)*(n-5) in terms of big Oh notation ____________

14.Time complexity of the recurrence relation T(n) = 4T(n/2) + n2 using the Master Theorem
is________

15. Time complexity of a binary search algorithm is__________

16. Best case time complexity of quick sort is__________

17. Solution of the recurrence relation T(n) = 2T(n/2) + n is _________


18. If an optimal solution can be created for a problem by constructing optimal solutions for its
subproblems, the problem possesses ____________ property.

19. In dynamic programming, the technique of storing the previously calculated values is called
___________

20. Objective of the 0/1 Knapsack Problem is to __________

21. 17. Solution of the recurrence relation T(n) = 2T(n/4) + nlogn is _________

22. 13. Express the formula (3n-1)*(nlogn-5) in terms of big Oh notation

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

A.BFS B. Dijkstra’s algorithm C. Prim’s algorithm D. Kruskal’s algorithm

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

A. Queue B stack c. Array d. Linked list

25. Which of the following is a Divide and Conquer


algorithm?
Bubble Sort
Selection Sort
Heap Sort
Merge Sort

26. Which of the following sorting algorithms provide the best time complexity in the
worst-case scenario?
Merge Sort
Quick Sort
Bubble Sort
Selection Sort

27. An algorithm is __________?


A problem
A procedure for solving a problem
A real-life mathematical problem
None of the above

28. Kruskal’s Algorithm for finding the Minimum Spanning Tree of a graph is a kind of
a?
DP Problem
Greedy Algorithm
Adhoc Problem
None of the above

29. The worst-case time complexity of Quicksort is?


O(n)
O(1)
O(log2n)
O(n^2)

30. To main measures of the efficiency of an algorithm are?


Time and space complexity
Data and space
Processor and memory
Complexity and capacity

You might also like