JNTU
JNTU B.Tech III DESIGN AND ANALYSIS OF ALGORITHMS Previous Question Paper (March - 2021 - R16)
Answer any five questions
All questions carry equal marks
Main
Discuss Strassen’s matrix multiplication as well as classical O(n3) one. Determine when Strassen’s method outperforms the classical one.
Answer
The classical matrix multiplication algorithm computes the product of two n x n matrices by calculating each element of the resulting matrix as a dot product of a row and a column. This requires three nested loops, leading to a time complexity of O(n3). Strassen's algorithm uses a divide-and-conquer approach to reduce the number of recursive multiplications from eight to seven. By partitioning the matrices into four sub-matrices and computing seven intermediate products, the recurrence relation becomes T(n) = 7T(n/2) + O(n2). Applying the Master Theorem, this results in a time complexity of O(nlog27), which is approximately O(n2.81).
Strassen's method outperforms the classical approach for large values of n. While Strassen's algorithm has a lower asymptotic complexity, it involves higher constant factors due to the additional matrix additions and subtractions. In practice, the crossover point where Strassen's method becomes more efficient typically occurs when n is between 64 and 128, depending on the specific hardware architecture and implementation details.
Define Time Complexity. Describe different notations used to represent these complexities.
Answer
Time Complexity is a measure of the amount of time an algorithm takes to run as a function of the length of the input. It provides an estimation of the growth rate of the number of operations performed by an algorithm.
The following asymptotic notations are used to represent these complexities:
- Big-O Notation (O): Provides an asymptotic upper bound on the growth rate of a function, representing the worst-case scenario.
- Omega Notation (Ω): Provides an asymptotic lower bound on the growth rate, representing the best-case scenario.
- Theta Notation (Θ): Provides an asymptotic tight bound, where the function is bounded both above and below by the same growth rate, representing the average or exact case.
- Little-o Notation (o): Denotes a loose upper bound, indicating that the growth rate is strictly less than the specified function.
- Little-omega Notation (ω): Denotes a loose lower bound, indicating that the growth rate is strictly greater than the specified function.
List and explain the applications of backtracking.
Answer
Sign in to view the complete answer paper.
Apply the greedy method to solve Knapsack problem for given instance. Where n=3, m=20, (p1,p2,p3)=(25,24,15), and weight (w1,w2,w3)=(18,15,10).
Answer
Sign in to view the complete answer paper.
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.
Answer
Sign in to view the complete answer paper.
Using branch and bound technique explain the 0/1 knapsack problem.
Answer
Sign in to view the complete answer paper.
Give a note on FIFO branch and bound solution.
Answer
Sign in to view the complete answer paper.
Explain the Bi-connected components in detail.
Answer
Sign in to view the complete answer paper.
Explain binary search and find its time complexity.
Answer
Sign in to view the complete answer paper.
Write an algorithm for finding maximum element of an array; perform best, worst and average case complexity with appropriate order notations.
Answer
Sign in to view the complete answer paper.
State and prove the Cook’s theorem.
Answer
Sign in to view the complete answer paper.