JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech II DESIGN AND ANALYSIS OF ALGORITHMS Previous Question Paper (August/September - 2022 - R15)
Answer any five questions
All questions carry equal marks
Main
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 is typically expressed using asymptotic notation, which describes the growth rate of the algorithm's running time as the input size approaches infinity.
The common notations used are:
- Big O Notation (O): Provides an asymptotic upper bound on the growth rate of a function, representing the worst-case time complexity.
- Omega Notation (Ω): Provides an asymptotic lower bound on the growth rate of a function, representing the best-case time complexity.
- Theta Notation (Θ): Provides an asymptotic tight bound, indicating that the function grows at the same rate as the given expression, representing the average-case complexity.
- Little o Notation (o): Represents an upper bound that is not asymptotically tight.
- Little omega Notation (ω): Represents a lower bound that is not asymptotically tight.
What is an algorithm? Explain about the process of validating an algorithm.
Answer
An algorithm is a finite, unambiguous, and step-by-step sequence of instructions designed to perform a specific task or solve a particular computational problem. It must satisfy properties such as input, output, definiteness, finiteness, and effectiveness.
The process of validating an algorithm involves ensuring that it correctly solves the intended problem and performs efficiently. This process consists of two primary stages:
- Correctness Proof (Proving): This involves using mathematical techniques, such as induction or loop invariants, to formally demonstrate that the algorithm produces the correct output for every valid input.
- Performance Analysis (Testing): This involves empirical testing and theoretical analysis. Testing includes executing the algorithm with various test cases (including boundary and edge cases) to verify output accuracy and identify runtime errors. Theoretical analysis involves determining the time and space complexity to ensure the algorithm meets resource constraints.
Explain the process of merge sort by a list of any 11 integers (distributed randomly). Write the algorithm and analyze its time complexity.
Answer
Sign in to view the complete answer paper.
Discuss about the time complexity of Strassen’s matrix multiplication.
Answer
Sign in to view the complete answer paper.
Give brief note on the job sequencing with deadlines.
Answer
Sign in to view the complete answer paper.
Briefly explain the all pairs shortest path problem with an example.
Answer
Sign in to view the complete answer paper.
Find an optimal solution to the knapsack instance n = 7, m = 15, P[1 : 7] = (10,5,15,7,6,18,3) and W [1: 7 ] = (2,3,5,7,1,4,1) using greedy method.
Answer
Sign in to view the complete answer paper.
Explain the procedure for solving the 0/1 knapsack problem using dynamic programming method. Apply this to the following instance and give the solution by showing the steps in detail. n = 6, (p1, p2, p3, p4, p5, p6) = (w1, w2, w3, w4, w5, w6) = (100, 50, 20, 10, 7, 3) and M = 165.
Answer
Sign in to view the complete answer paper.
Distinguish between greedy method and dynamic programming.
Answer
Sign in to view the complete answer paper.
Give the solution for 8-queens problem.
Answer
Sign in to view the complete answer paper.
Find the shortest tour of traveling sales person for the following cost matrix using dynamic Programming.
Answer
Sign in to view the complete answer paper.
Let w = { 5,7,10,12,15,18,20 } and m=35. Find all possible subsets of w that sum to m. Draw the portions of the state space tree that is generated.
Answer
Sign in to view the complete answer paper.
Write an algorithm to solve the Knapsack problem with branch and bound and explain with an example.
Answer
Sign in to view the complete answer paper.
Explain about NP-hard and NP-complete.
Answer
Sign in to view the complete answer paper.
Discuss the Non-deterministic algorithms.
Answer
Sign in to view the complete answer paper.