DAA Question Bank 24-25
DAA Question Bank 24-25
Basic Questions:
(Blooms Level- Understanding)
2. Compare betwcen best casc, worst case, and average case analysis?
3. Defineasymptotic notation. What are the different types of asymptotic notations?
4. What is a recurrence relation in the contextof
algorithm analysis?
5. Explain the significance of time complexity in algorithm design.
6. Discuss the classifications of time complexity.
2. Classify asymptotic
notations as per their functions.
7.Show importance
of Recurrence relation
using eg.
8 Show how Master Theorem is useful to solverecurrencerelation.
9. Solve following
recurrence relation using master theorem: T(n) = 8T(n/2)+n*
10Solve Binary search recurrence relation using master theorem.
12. Form recurrence
relation for Merge Sort.
13.Find upper bound,lower bound and avg. bound values for for fn)-2n'+3n+4
18. Define amortized analysis. How is it different from worst-case analysis and average-case
analysis?
19. Explain the significance of amortized analysis in algorithm design. Why is it useful for
analyzing certain types of algorithms?
20. List and briefly explain the three main techniques used in amortized
analysis.
21. What does it mean when we say that the amortized cost of an operation isconstant,cven
if some operations
occasionally take more time?
5. Solve Amortized
complexity of 4 bit binary
method. incrementer from 0 to 11 with proper
8.Propose a situation
PI analysis, where the best-case analysis is more
andjustify your useful than the worst-case
reasoning.
UNIT 2- Divide and Conauer Strategy, Greedy Strategy
3. Explain how the divide and conquer strategy applies to finding the maximum
sub-array.
1. Apply the quicksort algorithm to the following array: [7,2, 9, 4, 3, 1, 5], and show
the steps.
2. Use
-5,4].
ofmerge
to solve the maximum
and conquerapproach.
4. Compare the time complexities of quicksort and merge sort in their best, worst, and
averagecases.
5. Apply divide and conquer to solve the integer multiplication problem using
Karatsuba's algorithm.
6 Solve the fractional knapsack problem tor the given weights and values: [weight:
10 value: 60,weight: 20,value: 100,weight: 30,value: 120, weight: 10,value:
60.weight: 20,value: 100,weight: 30,value: 120], with a knapsackcapacity of 50.
Apply algorithm to
7. Dijkstra's the
following graph:
A-BO),A-C(4),B+C(1),BD),CDS). Find the shortest path from node A to all
other nodes.
knapsack problem.
Profit:30, Deadline:1,
Profit:40, Deadline:2,
Jobs =[Deadline:2, Profit:50,Deadline:1,
Profit:10]
Why is it more efficient than
of Dijkstra's algorithm.
15. Analyze the time complexity
worst-case performance.
in integer arithmetic operations.
use of divide and conquer
2. Elaborate the practical
this modification
may or may not work.
4. Explain the Floyd-Warshall algorithm for finding the all-pairs shortest path in a
graph.
theory?
6 What is a binomial coefficient?How is it defined mathematically?
7. Describe the sum of subset problem in dynamic programming.
8. How does dynamic programming reduce the time complexity of recursive
algorithms?
1. Apply dynamic programming to compute the binomial coefficient C(n,k) for n=5 and
k=2.
2. Solve the following instance of the 0/1 knapsack problem using dynamic
programming: Items = [weight: 2,value:3,weight: 3,value: 4,weight: 4,value: 5,
4. Apply the Floyd-Warshall algorithm to find the shortest paths for the following graph:
A+B(3),AC(8),B+C(2),C-A(5),BD(6),CD(4)
5. Analyze the time complexity of the
Bellman-Ford algorithm. How does it compare to
Dijkstra's algorithm?
6. How does dynamic programming solve the multistage graph problem more
efficiently than other methods?
7. Apply dynamie programming tocompute the OBST for the following frequencies of
S. Analyze the difference between the greedy solution and the dynamic programming
10. Explain how to fill the table (array) in the dynamic programming solution for
11.Use dynamic programming to compute the binomial coefficient for C(6,3), and
12. Compute C(10, 4) using dynamic programming. Demonstrate how the binomial
coefficient can be computed using both fullDP table and an optimized solution.
13. Explain the role of memoization in dynamic programming. How does it improve
14. Solve the following 0/1 knapsack problem using dynamic programming: Items =
[weight: 2,value: 3,weight: 3,value: 4,weight: 4,value: 5,weight: 5,value: 8],
Knapsack capacity = 5.
15. Apply the dynamic programming approach to compute the sum of subset problem for
SearchTree (OBST)
for the following keys and frequencies:
Creating)
for large datasets. How could you optimize the space complexity?
Propose an alternative approach to solving the sum of subset problem when the set
5.
solution?
7. Analyze a situation where dynamic programming would not be the best approach to
a business optimization scenario. How would you model the stages and decisions?
programming
Unit 4 : Backtracking Strategies
Basic Ouestions
(Bloom's Level:
Understanding)
1. Explain the
concept of backtracking in problem-solving. How does differ from
it
brute force
approaches?
2. Describe how backtracking is used to solve the N-Queens problem. What are the key
steps involved?
appropriate.
5. Explain how backtracking fits into the overall design paradigm of algorithms. How
does it approach problem-solving differently from greedy or divide-and-conquer
strategies?
9. Differentiate between the types of problems that are best solved using backtracking
Applying)
Moderate Questions (Bloom's Level:
I011I
I|010
0110I
11010
5. Using the backtracking approach, write the pseudocode to solve the 8-Queen
problem. Then, manually place queens on a 4x4 chessboard and demonstrate how the
6. Given a partially completed chessboard where 4 queens have already been placed,
use backtracking to place the remaining queens. Show the sequence of recursive calls
and decisions.
language of your choice. Explain how you would handle situations where placing a
8. Modify the backtracking algorithm for the 8-Queen problem to count the total
number of valid solutions instead of finding just one solution. Demonstrate the
9. Apply the backtracking method to solve a variant of the 8-Queen problem where
10. Using backtracking, write the pseudocode to solve a graph coloring problem with 4
vertices and 3 colors. Apply the algorithm lo a simple graph and demonstrate the
step-by-step process.
backtracking decisions.
and explain how you handle color assignments and
solve the graph coloring problem with the
13. Modify the backtracking approach to
14. Given a set of numbers 2,4, 6, 8, 10} and a target sum of 16, apply the backtracking
find subsets that sum up to 16. Show the step-by-step recursive calls
approach to all
15. Write the pseudocode for solving the sum of subsets problem using backtracking.
to find all subsets of the set (1,3, 5, 9} that sum to 10, and
Implement this algorithm
a backtracking algorithm that solves the sum of subsets problem for a set
16. Implement
and trace the steps where the
of integers. Apply this algorithm toa set of your choice
calculated.
the set contains both
sum of subsets problem where
18.Using backtracking, solve
a
process,
to find a Hamiltonian cycle in a given
19. Using backtracking, write the pseudocode
graph. Apply your algorithm to a graph with 5 vertices and demonstrate how the
evists Trace the recursive calls, decisions, and backtracking steps, showing when the
forward or backtracks.
algorithmmoves
solve the Hamiltonian cycle problem. Apply
21 Imnlement a backtracking algornm to
matrix and explain how you ensure that cach vertex is
it to a provided adjacency
the cycle
once, while maintaining constraint.
visited exactly
cycles in a
8-Queen problem. How does the search space affect the overall performance of the
algorithm?
2. Compare the backtracking approach for the 8-Queen problem with other potential
3. Examine the process of placing queens in the 8-Queen problem. At what stagesdoes
the algorithm backtrack, and how does it decide which queen to reposition? Provide a
4. Analyze the efficiency of the backtracking algorithm for solving the graph coloring
problem.What are the factors that influence the performanceof the algorithm,and
how can these factors be optimized?
5. Compare the backtracking approach for graph coloring with other techniques like
6. Examine the point at which backtracking occurs in the graph coloring problem.How
does the algorithm decide when to backtrack, and how does this impact the search for
a solution?
7. Compare the performance of the backtracking solution for the sum of subsets
problem with other approaches such as dynamic programming or brute force. Which
8. Examine how the problem size (number of elements in the set) and the target sum
affect the performance of the backtracking algorithm. How does increasing the
problem size impact the solution space, and what strategies could be used to manage
this?
Unit: 5 Branch and Bound
1, Explain the basie concept of the Branch and Bound technique, and the difference from
2.Deseribe how Branch and Bound is applied to solve the 0/1 Knapsack problem. Explain
the role of bounding functions and how they improve the efficiency of the algorithm.
3. Explain the diflerence between depth-first search (DFS) and breadth-first search (BFS)
strategies in the context of Branch and Bound. When would you prefer one over the other?
4. Explain how the FIFO queue is used to explore the solution space in the Branch and
Bound algorithm.
5. Describe how the FIFO strategy differs from other Branch and Bound strategies like LIFO
and Best-First Search.
6. Explain how the LIFO (stack-based)strategy is used in the Branch and Bound algorithm
7. How does the LIFO Branch and Bound differ from the FIFO and Best-First Branch and
Bound approaches?
8. Explain how the Least Cost Branch and Bound technique determines which node to
9. Describe the difference between Least Cost Branch and Bound and the general Branch
10. Explain the process of solving the 0/1 Knapsack problem using Branch and Bound. How
I1. How does the Branch and Bound technique for the 0/1 Knapsack problem ensure that the
Branch and Bound method is used to solve the TSP. What role do Jower
12. Explain how the
force.
1. Demonstrate how theFIFO Branch and Bound method can be applied to solve a simnle
01Knapsack problem.
2.
Apply the FIFO Branch small Traveling Salesman
and Bound approach to solve a
Problem (TSP).
3. Apply the LIFO Branch and Bound approach to solve the 0/1 Knapsack problem. Show
the steps involved.
4. Use LC Branch and Bound to find a solution to a Traveling Salesman Problem (TSP) with
4 cities.
3. Apply the Branch and Bound method to solve a 0/1 Knapsack problem with 3 items, given
6. Use Branch and Bound to demonstrate how to discard suboptimal branches when solving
how use the Least Cost Branch and Bound algorithm to solve a simple
8. Demonstrate to
Apply the Branch and Bound method to solve a small Traveling Salesperson Problem for
9.
10. Use the Branch and Bound approach to demonstrate how to prune suboptimal paths
1. Analyze the impact of using a FIFO queue on the efficiency of the Branch and Bound
Bound algorithm.
usage in the Branch and
complexity and memory
to a
solution Traveling Salesman Problem (TSP)
and Bound to find a of a
4, Use LC Branch
given matrix.
o 10 5
8 9
4 6
5. How does the LIFO approach affect the order in which nodes are explored? Provide an
6. Compare the effectiveness of the Least Cost Branch and Bound approach with the
Best-First and Depth-First Branch and Bound methods in terms of memory and time
complexity.
7. Analyze the time complexity of solving the 0/1 Knapsack problem using the Branch and
8. Compare the Branch and Bound method for the 0/1 Knapsack problem with the Greedy
ont 1.Evaluate the situations where the FIFO Branch and Bound approach would be more
2. Evaluate the scenarios in which the LIFO Branch and Bound technique is more efficient
3.Evaluate the advantages of using the Least Cost Branch and Bound method for solving
4. Evaluate the effectiveness of different bounding functions (e.g, linear relaxation) used in
Branch and Bound for solving the 0/1 Knapsack problem.gnuuk pe one
5. Propose an enhancement to the standardBranch and Bound algorithm for solving the 0/1
7. Show the relation between P, NP, NP Hard and NP complete using Ven Daigram.
5. Use reduction techniques to show that a certain problem belongs to class NP.
efficiency.
results.
8. Solve the vertex cover problem using approximation and discuss the complexity.
performance.
12. Demonstrate how a reduction can simplify a graph problem in complexity theory.
computational feasibility.
15. Show
how a
known NP-complete problem can be used to prove the NP-completeness
of a new problem.
its
packing problem and discuss
algorithm for the bin
pement an approximation
efficiency.
Level: Analyze)
Higher Order Thinking Skills (HOTS)Questions(Bloom's
in both deterministic and
complexity of a problem
1. Analyze the time
non-deterministicmodels.
problems using
2. Compare the space and time complexity of solving NP-complete
algorithms.
brute force and approximation
of the P vs. NP question in complexity theory.
3. Analyze the significance
challenges.
methods for solving
the performance of exact algorithms and heuristic
5. Compare
NP-hard problems.
in solving NP-hard
the trade-offs between space and time complexity
6. Analyze
techniques.
problems using various in solving
with greedy algorithms
dynamic programming
7. Compare the efficiency of
NP-complete problems.
backtracks in the sum of subsets problem.
9. Analyze the points where the algorithm
I1. Critically analyze the effectiveness of backtracking forsolving the Hamiltonian cycle
challenges does backtracking face in directed graphs, and how can the algorithm be
adapted?
12. Identify the points in the backtracking process where the algorithm decides to
backtrack in the Hamiltonian cycle problem. How do these decision points affect the