JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B. Tech III Year DESIGN AND ANALYSIS OF ALGORITHMS Previous Question Paper (March - 2024 - R16)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory (25 marks). iii) In Part B, Answer any one question from each unit (10 marks each).
Part A
What is time complexity?
Answer
Time complexity is a computational concept that quantifies the amount of time an algorithm takes to complete as a function of the length of the input. It provides a theoretical estimate of the growth rate of an algorithm's execution time rather than measuring the exact clock time, which depends on hardware and implementation details.
It is typically expressed using Asymptotic Notation, such as Big O notation, which describes the upper bound of the algorithm's running time. For an input size denoted by n, the time complexity represents the number of elementary operations performed by the algorithm.
This measure is crucial for evaluating the efficiency and scalability of an algorithm, allowing developers to predict how performance will degrade as the input size increases.
What are randomized algorithms?
Answer
A randomized algorithm is an algorithm that employs a degree of randomness as part of its logic. Unlike deterministic algorithms, which always produce the same output for a given input and follow a fixed sequence of operations, a randomized algorithm makes decisions based on random numbers generated during its execution.
Key characteristics and classifications include:
- Non-deterministic behavior: The running time or the output of the algorithm depends on the random choices made, meaning the performance can vary across different runs for the same input.
- Las Vegas Algorithms: These algorithms always produce the correct result, but their running time is a random variable. A classic example is Randomized QuickSort, where the pivot is chosen randomly to ensure an expected time complexity of O(n log n)regardless of the input distribution.
- Monte Carlo Algorithms: These algorithms have a deterministic running time, but there is a non-zero probability that the output may be incorrect. The probability of error can often be reduced to an arbitrarily small value by repeating the algorithm multiple times.
Randomized algorithms are frequently used to simplify complex problems, improve average-case performance, or break symmetry in distributed systems where deterministic approaches might suffer from worst-case scenarios.
What are biconnected components?
Answer
Sign in to view the complete answer paper.
Write down the algorithm for union().
Answer
Sign in to view the complete answer paper.
Distinguish between backtracking and greedy approach.
Answer
Sign in to view the complete answer paper.
What are the applications of single source shortest path?
Answer
Sign in to view the complete answer paper.
What is chained matrix multiplication?
Answer
Sign in to view the complete answer paper.
What is time and space complexity of all pairs shortest path using dynamic programming approach?
Answer
Sign in to view the complete answer paper.
What is NP hard problem?
Answer
Sign in to view the complete answer paper.
What is meant by state space tree?
Answer
Sign in to view the complete answer paper.
Part B
What is the basic idea of Quick sort algorithm? Write an algorithm for quick sort and derive its time complexity. Also perform quicksort on the following data: 3,2,8,9,11,42,27,5,7
Answer
Sign in to view the complete answer paper.
Explain strassen’s matrix multiplication? Show how time complexity of this algorithm is reduced through divide and conquer method.
Answer
Sign in to view the complete answer paper.
Write an algorithm and explain how to find Hamiltonian cycles through backtracking approach.
Answer
Sign in to view the complete answer paper.
What is n-queens problem? Write an algorithm and find the solution to it using backtracking approach.
Answer
Sign in to view the complete answer paper.
What is minimum cost spanning tree? Explain prim’s and krushkal’s algorithm to find minimum cost spanning tree with an illustrative example.
Answer
Sign in to view the complete answer paper.
State and explain knapsack problem. Give solution to it using greedy approach.
Answer
Sign in to view the complete answer paper.
What are optimal binary search trees? Write down algorithm for it and derive its time complexity.
Answer
Sign in to view the complete answer paper.
Define travelling salesperson problem. Give solution to it using backtracking approach. Write down algorithm for it and illustrate with an example.
Answer
Sign in to view the complete answer paper.
Give FIFO Branch and Bound solution to 0/1 Knapsack problem.
Answer
Sign in to view the complete answer paper.
State and explain cook’s theorem.
Answer
Sign in to view the complete answer paper.
Explain about NP complete problems.
Answer
Sign in to view the complete answer paper.