Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech III ALGORITHM DESIGN AND ANALYSIS Previous Question Paper (February/March - 2022 - R18)
Answer any five questions. All questions carry equal marks.
Main
What are the features of an efficient algorithm? Explain with an example.
Answer
An efficient algorithm is characterized by its ability to solve a problem using minimal computational resources, specifically time and space. The key features include:
- Input/Output: It must have zero or more inputs and produce at least one output.
- Definiteness: Each step must be clear, unambiguous, and precise.
- Finiteness: The algorithm must terminate after a finite number of steps for any valid input.
- Effectiveness: Every instruction must be basic enough to be carried out exactly and in a finite amount of time.
- Generality: It should be applicable to a range of inputs rather than a single specific case.
For example, consider the Binary Search algorithm. Compared to a linear search, it is highly efficient for sorted arrays because it reduces the search space by half in each step, resulting in a time complexity of O(log n). This demonstrates efficiency by minimizing the number of comparisons required to locate an element.
Write control Abstraction algorithm of Divide – and Conquer.
Answer
The control abstraction for the Divide and Conquer strategy represents the general structure of the algorithm, where a problem is split into subproblems, solved recursively, and then combined.
Algorithm DAndC(P) {
if (Small(P)) return S(P);
else {
Divide P into smaller instances P1, P2, ..., Pk;
Apply DAndC to each subproblem;
return Combine(DAndC(P1), DAndC(P2), ..., DAndC(Pk));
}
}In this abstraction, Small(P) checks if the problem size is small enough to be solved directly, S(P) provides the direct solution, and Combine merges the results of the recursive calls.
Give the Big – O notation definition and briefly discuss with suitable example.
Answer
Sign in to view the complete answer paper.
Explain recursive functions algorithm analysis with an example.
Answer
Sign in to view the complete answer paper.
What is stable sorting method? Is Merge sort a stable sorting method?
Answer
Sign in to view the complete answer paper.
Explain the Graph – coloring problem. And draw the state space tree for m= 3 colors n=4 vertices graph. Discuss the time and space complexity.
Answer
Sign in to view the complete answer paper.
Write the backtracking algorithm for the sum of subsets problem using the state space tree corresponding to m=35, w = (20,18,15,12,10,7,5). Also draw the state space tree.
Answer
Sign in to view the complete answer paper.
Explain the Optimal Binary Search Tree with an example.
Answer
Sign in to view the complete answer paper.
Find the shortest path of the following by using all pairs shortest path.
Answer
Sign in to view the complete answer paper.
Design a 3 stage system with device types D1, D2, D3. The costs are Rs 30, 15, 20 respectively. The cost of system is to be no more the Rs 105. The reliability of each device type is 0.9, 0.8 and 0.5 respectively.
Answer
Sign in to view the complete answer paper.
Find optimal solution to the knapsack problem instance n=6, m=15, (p1…p6) = (10,5,15,7,6,18), (w1…w6) = (2,3,5,7,1,4).
Answer
Sign in to view the complete answer paper.
Write a greedy algorithm for sequencing unit time jobs with deadlines and profits.
Answer
Sign in to view the complete answer paper.
Draw the portion of state space tree generated by LCBB for the 0/1 Knapsack instance: n = 5, (p1,p2,…,p5) = (10,15,6,8,4), (w1,w2,..,w5) = (4,6,3,4,2) and m=12. Find an optimal solution using fixed – tuple sized approach.
Answer
Sign in to view the complete answer paper.