DSA - Question Bank - 2023
DSA - Question Bank - 2023
5 What is top of stack? Why stack is called LIFO list and queue is called FIFO list.
6 What is a circular queue? How do you check the queue full condition? Write an algorithm to count
the nodes in a circular queue.
7 Compare sequential searching with binary searching in detail.
8 Examine the algorithm for Insertion sort and sort the following array: 77, 33, 44, 11, 88, 22, 66, 55
10 Explain malloc and free functions in ‘C’. Also discuss advantages of dynamic over static memory
allocation.
11 Discuss an algorithm for infix to postfix conversion with example
12 Write an algorithm to evaluate postfix expression. Explain working of the algorithm using
appropriate example.
13 Write a ‘C’ program to reverse a string using stack
14 Write algorithm to (i) insert, and (ii) delete elements in circular queue
24 Describe the algorithm for Evaluating postfix expression and Evaluate the following postfix
expression in tabular form: 3 5 * 6 2 / +.
25 Explain Dequeue and Priority queue in detail.
28 Perform the analysis of a recurrence relation T(n)= 2𝑇 (n/2)+ 𝜃(𝑛2) by drawing its recurrence tree.
29 “A greedy strategy will work for fractional Knapsack problem but not for 0/1", is this true or false?
Explain.
30 Explain the steps of greedy strategy for solving a problem.
32 Explain why analysis of algorithms is important? Explain: Worst Case, Best Case and Average
Case Complexity with suitable example.
33 Write and analyze an insertion sort algorithm to arrange n items into ascending order.
37 Using greedy algorithm find an optimal schedule for following jobs with n=7 profits: (P1, P2, P3,
P4, P5, P6, P7) = (3, 5, 18, 20, 6, 1, 38) and deadline (d1, d2, d3, d4, d5, d6, d7) = (1, 3, 3, 4, 1, 2,
1)
38 What is asymptotic notation? Find out big-oh notation of the f(n)= 3n2+5n+10.
39 Write iterative and recursive algorithm for finding the factorial of N. Derive the time complexity of
both algorithms.
40 Solve following recurrence relation using iterative method T(n)=2T(n / 2) + n
41 Explain master theorem and solve the recurrence T(n)=9T(n/3)+n with master method
44 Apply greedy algorithm and find optimal sequence of jobs. Given Profits = {40, 80, 50, 30, 20} and
deadlines = {3, 2, 2, 1, 3}
45 Apply Kruskal’s algorithm and find minimum spanning tree from given graphs
47 Find minimum spanning tree for the given graph using prim’s algorithm