Aoa Unit Test 1 Question Bank
Aoa Unit Test 1 Question Bank
1. What is the importance of space and time complexity in algorithm analysis, and how do
they impact performance?
2. How do Big-O, Omega, and Theta notations help in measuring the efficiency of an
algorithm?
3. What are the complexity classes P, NP, NP-Hard, and NP-Complete, and why are they
significant in computational theory?
4. How do the substitution method, recursion tree method, and master method help in
solving recurrence relations?
5. What is the time complexity analysis of Selection Sort and Insertion Sort, and how do
they compare in terms of efficiency?
1. What is the Divide and Conquer approach, and how does it differ from other problem-
solving techniques?
2. How does Merge Sort use the Divide and Conquer approach, and what is its time
complexity?
3. What is the working principle of Quick Sort, and how does its worst-case complexity
compare to its average-case complexity?
4. How can the Divide and Conquer technique be used to find the minimum and maximum
elements in an array, and what is its efficiency?
5. How does Binary Search utilize the Divide and Conquer method, and what is its time
complexity in the best, worst, and average cases?
1. Write an algorithm for the Greedy Knapsack approach and solve the following Fractional
Knapsack Problem:
Given:
Number of items (n) = 5
Knapsack capacity (m) = 100
Profits (p1, p2, ..., p5) = (10, 20, 30, 40, 50)
Weights (w1, w2, ..., w5) = (20, 30, 66, 40, 60)
Find the maximum profit that can be obtained using the Greedy approach, where items can be
taken fractionally based on their profit-to-weight ratio.
2. What is the Greedy Method approach, and how does it differ from Divide and Conquer?
3. How does Dijkstra’s algorithm find the shortest path in a weighted graph, and what is its
time complexity?
4. How does the Job Sequencing with Deadlines problem use the Greedy method for
optimal scheduling?
5. What are the differences between Kruskal’s and Prim’s algorithms for finding the
Minimum Cost Spanning Tree (MST), and how do their time complexities compare?What
are the differences between Kruskal’s and Prim’s algorithms for finding the Minimum
Cost Spanning Tree (MST), and how do their time complexities compare? Construct a
minimum spanning tree using kruskal’s algorithm for the graph given below