Algorithm Questionbank
Algorithm Questionbank
Algorithm Questionbank
Noida
Department of Computer Science & Engineering
B.Tech CSE/IT/AIML- V Semester (2023-2024)
Question Bank -1
Course Name: Design and Analysis of Algorithm AKTU Course Code: KCS 503
Question CO Level
S.
No.
You are given an array of n integers a1 < a2 <a3 ……<an. Give an CO1 L2
1. O(log n) . Algorithm that finds index i where ai=i or prove that i
does not exist.
Illustrate the operation for BUCKET SORT on the array A = < .79, CO1 L3
2. .13, . 16 , .64 , .39, .20 , .89 , .53 ,.71, .42>
5. Discuss any one sorting algorithm having linear time complexity. CO1 L1,L2
6. Find the solution of the following recurrence relation using recursion CO1 L5
tree method T(n) = T(n/3) + T(2n/3) + O(n)
8. 2. Write the algorithm for Quick sort. Prove that the running time CO1 L1,L2
complexity of Quick sort is O(n log n) in average.
13. Solve the recurrences :T(n) = T(α.n) + T((1-α).n)+n 0<α<1 CO1 L1,L5
14.3. Write an algorithm to count the number of nodes in a given circular CO1 L5
linked list
15. Write an algorithm for counting sort. CO1 L1,L2
17. Write an algorithm for Merge Sort. Explain analysis of algorithms. CO1 L1,L2
18. Sort the elements of the given array A using shell sort algorithm: CO1 L1,L2
A= [20,35,18,8,14,41,3,39]
Question CO Level
S.
No.
Explain and write algorithm for union of two binomial heaps. Also CO2 L1,L2
1. discuss the time complexity for the same.
Prove that Red Black trees with n internal nodes has height at most 2 CO2 L2,L3
2. log(n+1).
3. Make the red black tree after successively inserting the keys 2, 1, CO2 L5
0,4,7, -1, -2 into an initially empty red black tree.
4. Prove that Red Black trees with n internal nodes has height at most 2 CO2 L3
log(n+1).
5. Write all the cases of the Red Black trees insertion operation. CO2 L1,L2
7. Write the properties of Binomial tree. Prove that the maximum degree CO2 L1,L2
of any node in a n- node binomial tree is log n .
8. Write the method of retrieving an element with a given rank. CO2 L1,L2
13. Let d=┌ m/2 ┐and let n be the number of elements in the B-trees CO2 L1,L2
show that 2 d h-1 ≤ n ≥ m h - 1 where h is the height of the tree.
14. Write all the cases of Red Black Tree Deletion operation. CO2 L1
15. Write and Prove that all the properties of Binomial Tree. CO2 L1,L2
16. Show the red black trees that result after successively inserting the CO2 L5
keys 41, 38 , 31 , 12 , 19, 8 into an initially empty red black tree.
17. Delete the keys in reverse order of inserting the keys RB Tree from CO2 L1,L2
above question.
18. Make the red black tree after successively inserting the keys CO2 L5
10,20,30,40,50,60 and 70 into an initially empty red black tree.
19. Define Fibonacci Heap. Differentiate between Binomial and CO2 L1,L2
Fibonacci Heap.
20. Explain and write algorithm for union of two binomial heaps. Also CO2 L2
discuss the time complexity for the same.
DGI, Gr. Noida
Department of Computer Science & Engineering
B.Tech CSE/IT/AIML- V Semester (2023-2024)
Question Bank -3
Course Name: Design and Analysis of Algorithm AKTU Course Code: KCS 503
Question CO Level
S.
No.
When and how Dynamic approach is applicable? Discuss matrix-chain CO3 L2
1. multiplication with respect to Dynamic programming technique.
Use Strassen’s algorithm to compute the product of two given matrices: CO3 L3
1 3 and 8 4
2. 5 7 6 2
3. Describe greedy method. Find the optimal solution to the Knapsack CO3 L1
instance n=3 , W={ 100,16,100},P={20,18,15} and C=116 using greedy
method .Describe 0/1 Knapsack using dynamic method.
4. Consider the following 0/1 Knapsack problem in which no. of item n is 5 CO3 L3
whose values v={ 20,50,30,100,60} and weights w={5,40,30,20,15} and
W=50. Find the optimal solution and also the optimal solution.
5. What is Greedy Algorithm? Write the properties of greedy algorithm. CO3 L1,L2
8. Explain Strassen Matrix multiplication . Also write the algorithm. CO3 L1,L2
13. Give the difference between dynamic programming and greedy approach. CO3 L1,L5
14. Apply the Bellman Ford algorithm in the following graph CO3 L5
15. Explain Dynamic approach for solving Zero one Knapsack problem. CO3 L1,L2
16. Find the optimal solution to the Knapsack instance n=5, W={ 1,2,5,6,7} CO3 L5
and P={1,6,18,22,28} and C=11 using dynamic method.
17. What is Minimum Spanning tree ? Explain application of MST. CO3 L1,L2
Question CO Level
S.
No.
Let set S ={1,2,3,4} and weight vector ={10,25,5,10} and M=25. Find subset CO4 L5
1. sum using backtracking.
4. Give the difference between dynamic programming and backtracking. CO4 L1,L2
5. Explain Travelling Salesman Problem by using Branch and Bound method CO4 L1,L2
6. What is Hamiltonian cycle problem? Write its complexity and algorithm. CO4 L2
9. Let set S ={1,2,3,4} and weight vector ={1,2,5,78,10,15,20,25} and M=30. CO4 L5
Find subset sum using backtracking.
10. Find the optimal solution to the Knapsack instance n=5, W={ 1,2,5,6,7} and CO4 L5
P={1,6,18,22,28} and C=10 using dynamic method.
11. What is Dynamic Programming ?Explain your answer with an example. CO4 L1,L2
12. What is n queen problem? Write its complexity and algorithm. CO4 L2
13. What is Graph Coloring problem? Write its complexity and algorithm. CO4 L1,L5
14. What is Sum of Subset problem? Write its complexity and algorithm. CO4 L5
15. Explain Travelling Salesman Problem . Show that a TSP can be solved using CO4 L1,L2
backtracking in the exponential time.
17. What is Hamiltonian cycle? Write its complexity and algorithm. CO4 L1,L2
18. Explain Dynamic approach for solving Zero one Knapsack problem. CO4 L1,L2
19. Describe Floyd Warshal’s algorithm to find all pairs shortest paths in a CO4 L1,L2
directed network.
Question CO Level
S.
No.
Discuss Randomized Algorithm. CO5 L1,L2
1.
Explain Approximation algorithm with example. CO5 L2
2.
3. What is NP Completeness ? CO5 L1,L3
4. Explain and write KMP algorithm for pattern matching and also CO5 L1,L2
comment on its running time.