0% found this document useful (0 votes)
37 views9 pages

DAA Questions External

The document contains a comprehensive list of short and long answer questions related to algorithms, data structures, and complexity analysis. Topics include time and space complexity, various algorithmic strategies such as greedy and dynamic programming, and specific problems like the knapsack problem and traveling salesperson problem. It also covers algorithm design principles, graph theory concepts, and performance analysis techniques.

Uploaded by

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

DAA Questions External

The document contains a comprehensive list of short and long answer questions related to algorithms, data structures, and complexity analysis. Topics include time and space complexity, various algorithmic strategies such as greedy and dynamic programming, and specific problems like the knapsack problem and traveling salesperson problem. It also covers algorithm design principles, graph theory concepts, and performance analysis techniques.

Uploaded by

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

Short Answer Questions

1. In what way a time complexity differs from space complexity.


2. How can we measure an algorithm’s running time?
3. What is a set? List the operations that can be performed on it.
4. What is the importance of knapsack algorithm in our daily life?
5. What is greedy strategy? Explain.
6. What is reliability design?
7. What are the applications of dynamic programming?
8. What is NP-hard problem?
9. What is meant by non-deterministic algorithm
10. What is time complexity?
11. What are biconnected components?
12. Write down the algorithm for union().
13. Distinguish between backtracking and greedy approach.
14. What are the applications of single source shortest path?
15. What is time and space complexity of all pairs shortest path using dynamic programming
approach?
16. What is NP hard problem?
17. What is meant by state space tree?
18. Define θ-notation and Omega notation.
19. How do you measure the algorithm running time?
20. What is a set? List the operations that can be performed on it.
21. State and explain graph coloring problem.
22. Define greedy method.
23. What are the drawbacks of greedy method?
24. State the principle of optimality.
25. Write about reliability designing.
26. Define NP-Complete.
27. Why the search path in a state-space tree of a branch and bound algorithm is terminated?
28. Define Big ‘Oh’ notation.
29. Compare Quick Sort and Merge Sort.
30. What is an articulation point in a graph? Give an example.
31. Construct the state space tree for 4-Queens problem with bounding function.
32. Write an algorithm for simple Union operation.
33. Write the difference between the Dynamic programming and the Greedy method.
34. What is mean by state space tree? Give an example.
35. Define cook’s theorem.
36. Draw the relation of P, NP, NP-Hard and NP-Complete.
37. In what way a time complexity differs from space complexity.
38. Give the general plan of divide and conquer algorithms.
39. Write an algorithm for collapsing find.
40. Define Backtracking? List the applications of Backtracking
41. What is the importance of knapsack algorithm in our daily life?
42. Write Control Abstraction of Greedy method.
43. What you mean by dynamic programming.
44. Define optimal binary search tree with an example.
45. State the difference between FIFO and LC Branch and Bound algorithms.
46. Write the Control Abstraction of Least – Cost Branch and Bound.

Long Answer Questions


Unit 1
1. Define time and space complexity. Explain with examples.
2. For T(n)=7T(n/2)+18n2 Solve the recurrence relation and find the time complexity.
3. Differentiate between Bigoh and omega notation with example
4. Explain about Disjoint set operations
5. Explain binary heap algorithm with its complexity analysis.
6. Explain the process of designing an algorithm. Give characteristics of an algorithm
7. Show that the following equalities are correct:
a) 5n2 - 6n = θ (n2)
b) n! = O(nn)
8. Solve the recurrence relation T(n)=T(n-1)+n for n > 0 T(0)=1
9. How to implement disjoint sets? Explain.
10. Illustrate heap sort for the elements 2, 3, 7, 1, 8, 5, 6 ?
11. Describe performance analysis, space complexity and time complexity.
12. What are asymptotic notations? Explain with examples.
13. Solve the recurrence relation T(n)=T(n/2)+n for n > 1 T(1)=1
14. Discuss union and find algorithms in detail with an example
15. Explain Priority Queue and how it is different from Heap?
16. Write the asymptotic notations used for best case ,average case and worst case analysis of
algorithms and Write an algorithm for finding maximum element of an array perform
best , worst and average case complexity with appropriate order notations
17. Show that the following equalities are correct:
a) 2n22n + n log n = θ (n22n)
b) n3 + 106n2 = θ (n3).
18. Solve the recurrence relation T(n)=T(n -1) + 5 for n > 0 T(0)=1
19. Write and explain find algorithm with collapsing rule.
20. Discuss about heap sort with complexity analysis
21. What are the different mathematical notations used for algorithm analysis.
22. Differentiate between Best, average and worst case efficiency.
23. Solve the recurrence relation T(n)=2T(n/2)+n for n > 1 T(1)=1
24. What is weighting rule for Union(i, j)? How it improves the performance of union
Operation?
25. Define min heap and max heap with example
26. Define time complexity and space complexity. Write an algorithm for adding n natural
numbers and find the space required by that algorithm.
27. Discuss in detail various notations used for expressing the time complexity of algorithms,
with examples.
28. Solve the recurrence relation T(n)=T(n/2)+nlogn for n > 1 T(1)=1
29. Write an algorithm of weighted union and also compute the time complexity of the same.
30. Illustrate the process of insertion and deletion of elements in max heap?
31. What is space complexity? Explain with suitable examples.
32. Explain in detail about asymptotic notations.
33. Solve the recurrence relation T(n)=3T(n-2)+n for n > 0 T(0)=1
34. How to implement disjoint sets? Explain.
35. Explain various heap operations.
Unit 2
1. Using Merge sort, sort the following elements:
310, 285, 179, 652, 351, 423, 861, 254, 450, 520
2. Derive the time complexity of Strassen’s matrix multiplication.
3. Explain Recursive Binary search algorithm with suitable examples.
4. Explain the problem of job sequencing with deadlines by taking an example. Write the
algorithm to solve the problem using the Greedy Method. Show how the algorithm solves
the following job sequencing with deadlines problem.
n = 4, (p1, p2, p3, p4) = (100, 10, 15, 27) and (d1, d2, d3, d4) = (2, 1, 2, 1)
5. Write the general method and Control Abstraction of Greedy method
6. Sort the records with the following index values in the ascending order using quick sort
algorithm. 2, 3, 8, 5, 4, 7, 6, 9, 1
7. Write and explain the general method of divide-and-conquer strategy.
8. Distinguish between Merge sort and quick sort.
9. Find an optimal solution to the knapsack instance n=7 objects and the capacity of
knapsack m=15. The profits and weights of the objects are (P1,P2,P3, P4, P5, P6, P7)=
(10, 5,15,7,6,18,3) (W1,W2,W3,W4,W5,W6,W7)= (2,3,5,7,1,4,1).
10. Illustrate the single-source shortest path algorithm for graph below
11. Write and explain quick sort algorithm with complexity analysis.
12. Write an algorithm for Binary search and discuss its complexity.
13. Derive the time complexity of Strassen’s matrix multiplication.
14. Explain algorithm for Job sequencing with deadlines
15. Define Greedy knapsack. Find the optimal solution of the Knapsack instance n= 7,
M=20, (p1, p2, ……p7) = (8,5,6,7,6,12,3) and (w1,w2,....w7)=(2,10,8,7,6,4,11)
16. Explain the process of merge sort by a list of any 11 integers (distributed randomly).
Write the algorithm and analyze its time complexity.
17. Give the general procedure of divide and conquer method.
18. Explain Strassen’s matrix multiplication and its time complexity
19. Discuss the single – source shortest paths (i.e. Dijkstra’s) algorithm with suitable
example and also find the time complexity
20. Derive time complexity of job sequencing with deadlines .Obtain the optimal solution
when n=5, (p1, p2,…)=(20,15,10,5,1) and (d1,d2,…)=(2,2,1,3,3).
21. Derive the time complexity of Merge sort algorithm for all cases.
22. Give the general plan of divide and conquer algorithms.
23. Discuss the time complexity of Binary search algorithm for best and worst case.
24. Explain the general method of Greedy method.
25. Apply Dijkstra’s for the below graph

26. Simulate Quick sort algorithm for the following example


25,36,12,4,5,16,58,54,24,16,9,65,78
27. Explain Strassen’s matrix multiplication and its time complexity
28. What is stable sorting method? Is Merge sort a stable sorting method?
29. Explain General method of Greedy method. Find the greedy solution for following job
sequencing with deadlines problem n = 7, (p1,p2,p3,p4,p5,p6,p7) = (3,5,20,18,1,6,30),
(d1,d2,d3,d4,…,d7) = (1,3,4,3,2,1,2)
30. Define Greedy knapsack. Find the optimal solution of the Knapsack instance n= 7,
M=15, (p1, p2, ……p7) = (10,5,15,7,6,18,3) and (w1,w2,. ...w7)=(2,3,5,7,1,4,1)
31. Write and explain recursive algorithm of binary search method. What is space
complexity? Explain with suitable examples.
32. Explain Merge sort (Stable sort (or) Not in-place) algorithm and trace this algorithm for n
=8 elements: 24,12, 35, 23,45,34,20,48
33. Write Divide – And – Conquer recursive Quick sort algorithm and analyze the algorithm
for average time complexity.
34. Calculate Shortest Distance from vertex 1 to all other vertices for the below graph

35. What is the solution generated by function Job Sequencing algorithm when n=6 (P1…p6)
= (3, 5, 20, 18, 1, 6), and (d1..d6) = (1, 3, 4, 3, 2, 1).
Unit 3
1. Draw an Optimal Binary Search Tree for n=4 identifiers (a1,a2,a3,a4) = ( do, if, read,
while) P(1:4)=(3,3,1,1) and Q(0:4)=(2,3,1,1,1).
2. Describe the travelling sales person problem with an example.
3. Use the function OBST to compute w(i, j), r(i, j), and c(i, j), 0 ≤ i < j ≤
4, for the identifier set (a1,a2,a3,a4) = (cout, float, if, while) with p(1)
= 1/20, p(2) = 1/5, p(3) = 1/10, p(4) = 1/20, q(0) = 1/5, q(1) = 1/10,
q(2) = 1/5, q(3) = 1/20, and q(4) = 1/20. Using the r(i, j)’s construct
the optimal binary search tree.
4. Discuss the time and space complexity of Dynamic Programming traveling sales person
algorithm.
5. Write an algorithm for all pairs shortest path. Define its complexity.
6. Compute the shortest distance between each pair of nodes for the following graph using
all pair shortest path algorithm.
7. Use the function OBST to compute w(i, j), r(i, j) and c(i, j), 0≤i≤j≤4 for
the identifier set (a1,a2,a3,a4)=(do, if, int, while) with p(1:4)=(3,3,1,1)
and q(0:4)=(2,3,1,1,1) using r(i,j)’s construct optimal binary search
tree.
8. Explain the time and space complexity of Dynamic Programming traveling sales person
algorithm.
9. Explain the all pairs shortest path problem with an example.
10. Write an algorithm of OBST.
11. What are optimal binary search trees? Write down an algorithm for it and derive its time
complexity.
12. Define the travelling salesperson problem. Give solution to it using backtracking
approach. Write down algorithm for it and illustrate with an example.
13. Given a set of cities and distance between every pair of cities, the problem is to find the
shortest possible route that visits every city exactly once and returns to the starting point
in the below figure.

14. Write an algorithm of all pairs shortest path.


15. Solve the following 0/1 Knapsack problem using dynamic programming P= (11, 21, 31,
33), W= (2, 12, 23, 15), C=42, n=4.
16. Draw an Optimal Binary Search Tree for n=4 identifiers (a1,a2,a3,a4) = ( do, if, read,
while) P(1:4)=(3,3,1,1) and Q(0:4)=(2,3,1,1,1).
17. With the help of suitable example explain the all pairs shortest path problem.
18. Solve a travelling sales person problem using dynamic programming
19. Write a function to compute lengths of shortest paths between all pairs of nodes for the
given adjacency matrix
20. Describe Travelling Salesperson Problem (TSP) using Dynamic Programming.
21. Let n=4 and (a1,a2,a3,a4) Construct optimal binary search for (a1, a2, a3, a4) = (do, if,
int, while), p(1 : 4) = (3,3,1,1) q(0 : 4)= (2,3,1,1,1)
22. Explain how solution will be provided for all pairs shortest path problem using dynamic
programming.
23. Let n=4 and (a1,a2,a3,a4) Construct optimal binary search for (a1, a2, a3, a4) = (cout,
float, if, while), p(1 : 4) = (1/20,1/5,1/10,1/20) q(0 : 4)= (1/5,1/10,1/5,1/20,1/20).
24. Explain optimal binary search tree with an example.
25. Explain 0/1 knapsack problem dynamic programming.
26. State dynamic programming. Explain with one application.
Unit 4
1. Write and explain the algorithm of Bi connected components with an example
2. Write an algorithm to find the strongly connected components in a diagraph.
3. What is an articulation point? How to find articulation point for a given graph.
4. Write a depth first search algorithm for graph traversal.
5. Compare and contrast between connected components and bi connected components.
6. Explain the following graph traversal
a. Depth First search
b. Breath First search
7. Discuss about the general method of backtracking.
8. Describe sum of subsets problem with an example.
9. Explain the solution to the graph coloring problem using backtracking.
10. Generate the state space tree and find the solutions for the subset sum for N=7, m=35,
w={5,7,10,12,15,18,20} using back tracking approach.
11. Write an algorithm to determine the Hamiltonian cycle in a given graph using
backtracking.
12. What is n-queens problem? Write an algorithm and find the solution to it using
backtracking approach.
13. List and explain the applications of backtracking.
14. Find a solution to the 8-Queens problem using backtracking strategy. Draw the solution
space using necessary bounding function.
Unit 5
1. Explain Cook’s theorem and its significance.
2. Explain the classes of NP-Hard and NP-Complete.
3. Show that the hamiltonian cycle problem on directed graphs is NP-complete.
4. Explain circuit satisfiability problem with a circuit diagram. Show that circuit
satisfiability problem is NP- hard.
5. Show that the hamiltonian path problem is NP-Complete.
6. Is the Travelling salesman problem NP-hard or NP-Complete? Justify your answer
7. Explain about NP-Complete problems
8. Discuss in detail about the class P, NP, NP-hard and NP-complete problems. Give
examples for each class.
9. Explain Satisfiability problem.
10. Write non-deterministic algorithm for knapsack problem?
11. Differentiate between NP - Hard and NP - Complete classes.
12. Discuss in detail about FIFO Branch and Bound solutions.
13. Explain LC branch and bound with an example
14. Generate the state space tree using FIFO Branch and Bound and find the shortest path
followed by the travelling salesperson instance defined by the cost matrix given below.

15. What is travelling salesman problem? Explain how it can be solved using Branch and
Bound method. Show the steps and solution by taking any one example containing atleast
5 cities and 10 ways to travel between them.
16. Using branch and bound technique explain the 0/1 knapsack problem.
17. Give a note on FIFO branch and bound solution
18. Given a set of 4 items, each with weight {2,2,4,5} and benefit {3,7,2,9}, Using LC
branch and Bound determine the items to include in the knapsack so that the total weight
is less than or equal to a given weight limit and the total benefit is maximized. The
weight limit for this knapsack is 10.
19. Explain about 0/1 Knapsack Problem using branch and bound with example.
20. Solve the Travelling Salesman problem using branch and bound algorithms.
21. Explain the FIFO BB 0/1 Knapsack problem procedure with the knapsack instance for
n=4, m=15,(p1,p2,p3,p4)=(10,10,12,18), (w1,w2,w3,w4) =(2, 4, 6, 9). Draw the portion
of the state space tree and find the optimal solution.
22. Draw the portion of state space tree generated by LCBB for the 0/1 Knapsack instance: n
= 5, (p1,p2,…,p5) = (10,15,6,8,4), (w1,w2,..,w5) = (4,6,3,4,2) and m=12. And also find
an optimal solution of the same.
23. Discuss Draw the portion of state space tree generated by FIFOBB for the following
instance of 0/1 knapsack n= 5, M=12, (p1, ……p5) = (10,15,6,8,4) (w1,. ...
w5)=(4,6,3,4,2)
24. Describe Travelling Salesperson Problem (TSP) using Branch and Bound.
25. Draw the portion of state space tree generated by LCBB for the following instance of 0/1
knapsack n=5, M=12, (p1, ……p5) = (10,15,6,8,4) (w1,.....w5)=(4,6,3,4,2)

You might also like