1. What does time complexity measure in an algorithm?
A . Number of operations executed
B . Amount of memory used
C . Number of lines of code
D . Input size
2. Which of the following best describes space complexity?
A . The amount of time an algorithm takes to run
B . The amount of memory an algorithm requires to execute
C . The number of inputs an algorithm can handle
D . The number of times an algorithm loops
3. What is the space complexity of an algorithm that creates a new array of size n?
A . O(1)
B . O(n)
C . O(log n)
D . O(n^2)
4. What is the time complexity of a binary search algorithm?
A . O(1)
B . O(n)
C . O(log n)
D . O(n^2)
5. What is the purpose of asymptotic notation in algorithm analysis?
A . To precisely measure the exact number of operations in an algorithm
B . To provide a rough estimate of algorithmic performance
C . To compare algorithms based on their exact execution times
D . To simplify the comparison of algorithms based on their growth rates
6. Which asymptotic notation represents the worst-case time complexity of an algorithm?
A . Θ(n)
B . O(n)
C . Ω(n)
D . All of the above
7. Which notation describes an Lower bound on the time complexity of an algorithm?
A . O(n)
B . Ω(n)
C . Θ(n)
D . All of the above
8. What does Θ(n) represent in asymptotic notation?
A . Best-case time complexity
B . Average-case time complexity
C . Tight bound on the time complexity
D . Worst-case time complexity
9. Which of the following is true about the relationship between O(n) and Ω(n)?
A . O(n) is always greater than Ω(n)
B . Ω(n) is always greater than O(n)
C . O(n) and Ω(n) are equal
D . There`s no relationship between O(n) and Ω(n)
10. What is the asymptotic notation for constant time complexity?
A . O(1)
B . O(n)
C . O(log n)
D . O(n^2)
11. What is a recurrence relation?
A . A relation between two variables that recurs infinitely
B . A relation between two functions that recurs infinitely
C . A mathematical expression that defines a function in terms of its value at smaller inputs
D . A mathematical expression that defines a function in terms of its value at larger inputs
12. Which of the following is a common notation for a recurrence relation?
A . R(n) = R(n-1) + R(n-2)
B . F(n) = F(n+1) - F(n-1)
C . P(n) = P(n^2)
D . Q(n) = 2 * Q(n/2)
13. What is the base case in a recurrence relation?
A . The case where the recurrence relation is true for all values of n
B . The case where the recurrence relation is true for some specific value of n
C . The smallest input value(s) for which the recurrence relation is defined directly
D . The largest input value(s) for which the recurrence relation is defined directly
14. Which method is commonly used to solve recurrence relations?
A . Iterative method
B . Dynamic programming
C . Master theorem
D . All of the above
15. What is the solution to the recurrence relation T(n) = 2T(n/2) + n?
A . O(n)
B . O(n log n)
C . O(n^2)
D . O(2^n)
16. In the Master Theorem, what does "a" represent in the form T(n) = aT(n/+ f(n)?
A . The number of subproblems
B . The ratio of subproblem size to original problem size
C . The coefficient of the leading term in the recurrence relation
D . The base case value
17. Which case of the Master Theorem applies when the work done at each level of recursion is asymptotically equal?
A . Case 1
B . Case 2
C . Case 3
D . None of the above
18. What is the time complexity of the recurrence relation T(n) = T(n/3) + T(2n/3) + n?
A . O(n)
B . O(n log n)
C . O(n^2)
D . O(n^3)
19. What is the Master Theorem used for?
A . Solving differential equations
B . Solving recurrence relations
C . Analyzing algorithmic time complexity
D . Finding prime numbers
20. What is the Master Theorem based on?
A . Divide and conquer strategy
B . Dynamic programming
C . Linear algebra
D . Graph theory
21. What is the time complexity of the recurrence relation T(n) = 4T(n/2) + n^2 using the Master Theorem?
A . O(n)
B . O(n log n)
C . O(n^2)
D . O(n^2 log n)
22. When applying the Master Theorem, what is compared to determine the complexity?
A . The number of subproblems and the size of each subproblem
B . The size of the original problem and the size of the subproblems
C . The number of recursive calls and the base case value
D . The coefficients of the leading terms in the recurrence relation
23. Which case of the Master Theorem applies when the work done at each level of recursion decreases geometrically?
A . Case 1
B . Case 2
C . Case 3
D . None of the above
24. What is the time complexity of binary search in the worst-case scenario?
A . O(1)
B . O(log n)
C . O(n)
D . O(n^2)
25. Quick sort is an example of a sorting algorithm based on which strategy?
A . Dynamic programming
B . Greedy approach
C . Divide and conquer
D . Backtracking
26. What is the worst-case time complexity of quick sort?
A . O(n)
B . O(n log n)
C . O(n^2)
D . O(log n)
27. What is the time complexity of merge sort in all cases?
A . O(n)
B . O(n log n)
C . O(n^2)
D . O(log n)
28. Strassen`s matrix multiplication is an algorithm that multiplies two matrices using which approach?
A . Brute force
B . Greedy approach
C . Dynamic programming
D . Divide and conquer
29. What is the time complexity of Strassen`s matrix multiplication algorithm?
A . O(n)
B . O(n log n)
C . O(n^2)
D . O(n^log7)
☞ Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]
☞ R - Programming MCQs - Unit-1 - [ R-Programming ]
☞ R - Programming MCQs - Unit-2 - [ R-Programming ]
☞ R - Programming MCQs - Unit-3 - [ R-Programming ]
☞ R - Programming MCQs - Unit-4 - [ R-Programming ]
☞ R - Programming MCQs - Unit-5 - [ R-Programming ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]
☞ PPS MCQs - Unit-1 - [ PPS ]
☞ PPS MCQs - Unit-2 - [ PPS ]
☞ PPS MCQs - Unit-3 - [ PPS ]
☞ PPS MCQs - Unit-4 - [ PPS ]
☞ PPS MCQs - Unit-5 - [ PPS ]
☞ Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]
☞ Software Engineering MCQs - Unit-1 - [ SE ]
☞ Software Engineering MCQs - Unit-2 - [ SE ]
☞ Software Engineering MCQs - Unit-3 - [ SE ]
☞ Software Engineering MCQs - Unit-4 - [ SE ]
☞ Software Engineering MCQs - Unit-5 - [ SE ]
☞ Data Mining MCQs - Unit-1 - [ DM ]
☞ Data Mining MCQs - Unit-2 - [ DM ]
☞ Data Mining MCQs - Unit-3 - [ DM ]
☞ Data Mining MCQs - Unit-4 - [ DM ]
☞ Data Mining MCQs - Unit-5 - [ DM ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]
☞ Data Structures Objective Type Question Bank-Unit-1 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-2 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-3 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-4 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-5 - [ DS ]
☞ Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]
☞ Cyber Forensics Objective Type Question Bank-Part-2 - [ Cyber Forensics ]
☞ Cyber Forensics Objective Type Question Bank-Part-1 - [ Cyber Forensics ]
☞ Java Programming Objective Type Question Bank - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-1 - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-2 - [ Java Programming ]