Why do you need analysis of algorithms? Explain RAM model for the analysis of algorithm with example.
What is recurrence relation? Solve the following recurrence relations using Master method.
a) T(n) = 4T(n/2) + n
b) T(n) = 3T(n/4) + n log n
What is the worst-case of quick sort? Show how quick sort can be made to run in O(n log n) time in the worst case assuming all elements are distinct.
Attempt any Eight questions
[8x5=40]Trace the heap-sort algorithm for the following data {4, 6, 17, 10, 12, 9, 8}.
You have given 5 jobs with profit pᵢ and deadline dᵢ as
| i | 1 | 2 | 3 | 4 | 5 |
| Pᵢ | 20 | 10 | 10 | 20 | 5 |
| dᵢ | 2 | 1 | 2 | 3 | 2 |
Find the optimal job lists that can be executed in a sequence within their deadline so as to maximize the profit.
Write algorithm to compute the LCS of given two sequences. Trace the running of the algorithm to find the LCS of the sequences {abbaba} and {aaaba}.
Write the Dijkstra's algorithm for single source shortest path in a graph. Find the shortest path from the node s to other nodes.
How can you determine the intersection of the two line segment efficiently? Explain with suitable examples.
How can you find the shortest path from a vertex of directed acyclic graph? Explain with example.
Define convex hull in 2D. Show that lower bound for computing the convex hull in 2D is Ω(n log n).
No question
No question