Algorithm Questionbank

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

DGI, Gr.

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>

3. Write the complexity of all sortings. CO1 L1

4. 1. What is time complexity of counting sort? Sort 1 9 3 3 4 5 6 7 7 8 CO1 L3


by counting sort .

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)

7. Solve the recurrence T(n) = 2 T(n/2) + n by Master method. CO1 L5

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.

9. Solve T(n) = 3 T(n1/3) + log 3 n . CO1 L5

10. Explain the term design and analysis of algorithms . CO1 L2

11. Solve the following recurrences. CO1 L5


(a) T(n) = 4T(n/3) + n2
(b) T(n) = T(9n/10) + n

12. Consider the polynomial CO1 L5


P(x) = (……..(cn*x+cn-1)*x+cn-2)*x+cn-
3)*x+…………………+)*x+c0
Estimate the time complexity to evaluate the polynomial P(x).

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

16. Discuss the analysis of Heap 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]

19. Find the solution of the following recurrence relation : CO1 L5


T(n) = T (n/2) + log n

20. What is asymptotic notation? Explain in details. . CO1 L2


DGI, Gr. Noida
Department of Computer Science & Engineering
B.Tech CSE/IT/AIML- V Semester (2023-2024)
Question Bank -2
Course Name: Design and Analysis of Algorithm AKTU Course Code: KCS 503

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

6. 1. Show the results of inserting the keys CO2 L5


F,S,Q,K,C,L,H,T,V,W,M,R,N,P,A,B,X,Y In order into an empty B-
tree with minimum degree 2.

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

9. Write the operation on the Fibonacci Heap. CO2 L5

10. What is implied by augmenting a data-structure? Explain with CO2 L2


example

11. Write an algorithm to find minimum and maximum elements CO2 L2


simultaneously from a given list of elements.
12. Define a B- Tree. CO2 L1

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

6. What is Knapsack Problem ? Discuss greedy approach for fractional CO3 L5


knapsack problem.

7. What is Dynammic Programming? Give the difference between dynamic CO3 L5


programming and divide and conquer.

8. Explain Strassen Matrix multiplication . Also write the algorithm. CO3 L1,L2

9. Consider the following alphabets {a,b,c,d,e,f} and f(a)=45, f(b)=13, CO3 L5


f(c)=12, f(d)=16, f(e)=9, f(f)=5 . Find the Huffman code for this data.

10. What is greedy algorithm? Explain with example. CO3 L1,L2


11. Explain Single source shortest Path problem with example. CO3 L2,L3

12. Find the LCS of X={1,0,0,1,0,1,0,1} and Y={0,1,0,1,1,0,1,1,0}. CO3 L5

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

18. Explain Kruskal’s algorithm with examle . CO3 L1,L2

19. What is Minimum Spanning tree ? Explain application of MST. CO3 L1


20. Find the minimum spanning tree of the given graph using Prim’s CO3 L5
DGI, Gr. Noida
Department of Computer Science & Engineering
B.Tech CSE/IT/AIML- V Semester (2023-2024)
Question Bank -4
Course Name: Design and Analysis of Algorithm AKTU Course Code: KCS 503

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.

Explain resource allocation problem. CO4 L3


2.
3. Give the difference between backtracking and branch and bound approach. CO4 L1

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

7. .Find the solution of 8-queen problem. CO4 L5

8. What is Backtracking ?Explain State space search tree CO4 L1,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.

16. Discuss n-queen problem. CO4 L1,L2

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.

20. Apply Floyd Warshall algorithm : CO4 L2


DGI, Gr. Noida
Department of Computer Science & Engineering
B.Tech CSE/IT/AIML- V Semester (2023-2024)
Question Bank -5
Course Name: Design and Analysis of Algorithm AKTU Course Code: KCS 503

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.

5. Show the comparisons the Naïve-String-Matcher makes for the CO5 L5


pattern P={10001} in the Text T={ 0000100010010}.

6. Explain Fast Fourier Transformation. CO5 L1,L2

7. Explain vertex cover problem. CO5 L1,L2

8. Describe Discrete Fourier Transform. CO5 L1,L2

9. Give the difference between DFT and FFT. CO5 L1,L2

10. What is NP Hard problem? CO5 L2

You might also like