Ads&aa Unit Wise Q-Bank
Ads&aa Unit Wise Q-Bank
Unit II
((Heap trees(priority Queues),graphs, Divide Conquer)
1.Do the following operations of priority queues?
(i) Construct the min and max priority queue with the following
Elements 20, 10, 5, 18, 6, 12, 14, 4, and 22.
(ii) Insert 2 and 28 in the min priority queue?
(iii) Perform two successive deletion operations on max priority queue?
2. Illustrate breadth first search traversal algorithm. Explain with an example.
3. Illustrate depth first search traversal algorithm. Explain with an example.
4. Discuss the working strategy of merge sort and illustrate the process of merge sort
algorithm for the given data: 43, 32, 22, 78, 63, 57, 91 and 13.
5. Illustrate the tracing of quick sort algorithm for the following set of numbers: 25, 10, 72,
18, 40, 11, 64, 58, 32, 9.(Note: Algorithm is also required)
Unit III
(First part : Greedy Algorithm)
1. Solve the following instance of knapsack problem using greedy method n=7(objects), m=15,
profits are (P1,P2,P3,P4,P5,P6,P7)=(10,5,15,7,6,18,3) and its corresponding weights are
(W1,W2,W3,W4,W5,W6,W7)=(2,3,5,7,1,4,1).
2. Write a greedy algorithm for sequencing unit time jobs with deadlines and profits.
3. Use the greedy algorithm for sequencing unit time jobs with deadlines and profits to generate
the solution when n=7, (p1, p2,…p7)=(3, 5, 20, 18, 1, 6, 30) and (d1, d2,…, d7)=(1, 3, 4, 3, 2, 1,
2). (Note: practice these types of Questions.Nums may be changed)
4. What is a Minimum Cost Spanning tree? Explain Kruskal’s Minimum cost spanning tree
algorithm with a suitable example.
5. Write and explain Prim’s algorithm for finding minimum cost spanning tree of a graph with an
example.
Unit IV
(Backtracking Branch and Bound)
1. State N-Queens problem and solve 8-Queens problem using backtracking.
2. Find all possible subsets of w that sum to m. Let w(1:6)={5,10,12,13,15,18} and m=30 and
draw the portion of the state space tree that is generated using backtracking.
3. Construct state space tree for m= 3 colors and n=4 vertices graph. Analyze time and space
complexity of the Graph coloring algorithm using backtracking.
4. Compare between different branch-and-bound approaches.
5. Generate FIFO branch and bound solution for the given knapsack problem, m = 15, n = 3, (P1,
P2, P3) = (10, 6, 8) and (w1, w2, w3) = (10, 12, 3).
6. Draw the portion of the state space tree generated by LC branch and bound of knapsack
problem for an instance n=4, (P1, P2, P3, P4) = (10, 10, 12, 18), (w1, w2, w3, w4)=(2, 4, 6, 9),
and m=15.
Unit V
(NP hard and NP complete,NP hard graph and scheduling problems)
1. Explain the P, NP, NP-Hard and NP- complete classes with suitable examples
2. Differentiate between NP hard and NP complete problems
(refer https://www.geeksforgeeks.org/difference-between-np-hard-and-np-complete-problem/
OR https://www.scaler.in/np-hard-and-np-complete-problem/)
3. Prove Travelling Sales Person problem is NP-Complete problem
(https://www.tutorialspoint.com/design_and_analysis_of_algorithms/
design_and_analysis_of_algorithms_np_hard_complete_classes.htm)
4. Prove that graph 3 coloring problem is an NP-Complete problem.
( https://www.geeksforgeeks.org/3-coloring-is-np-complete/)
5. Explain the satisfiability problem (Using Cook’s theorem)?
( https://www.geeksforgeeks.org/cook-levin-theorem-or-cooks-theorem/)
Note : Study algorithms and time complexity also