Design & Analysis of Algorithms UOS — University of Sargodha
Discussion
Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.
No questions yet — be the first to ask.
More Design & Analysis of Algorithms papers
See all
Design & Analysis of Algorithms BS 4 Semester/Term UOS — University of Sargodha 2024
Uploaded 27 days ago
Download ↓
Design & Analysis of Algorithms/Design and Analysis of Algorithm/Advance Analysis of Algorithms BS/MPhil Computer Science/MS Computer Science 4 Semester/Term University Of Sargodha (UOS) 2024
Uploaded 1 year ago
Download ↓
Design & Analysis of Algorithms BS 4 Semester/Term UOS — University of Sargodha 2021
Uploaded 3 years ago
Download ↓
Design & Analysis of Algorithms BSCS 5 Semester/Term UOS — University of Sargodha
Uploaded 3 years ago
Download ↓
Paper text
University of Sargodha
Paper: Analysis of Algorithms
Total Marks: 50
Time Allowed: 120 min
Roll #
Note: Attempt all questions.
Problem
1.
Answer the following questions briefly. Give examples where necessary.
i. Differentiate between min heap and max heap. [2]
ii. Prim's algorithm for computing MST and Dijikstra's algorithm for computing
shortest paths are similar in design. T/F [1]
iii. Differentiate between D.P approach and greedy approach. [4]
iv. Write down the recursive solution for assembly line scheduling. [2]
v. All pair shortest path can be calculated using greedy approach. T/F [1]
Problem
2.
i. Run Prim's MST algorithm on the graph given below. Also find how many MSTs
are there in this graph. [5+2]
ii. Write down the procedure that finds out the optimal solution in knapsack
problem. [3]
Problem
3.
i. Write down the recursive solution for knapsack problem. [1.5]
ii. Write down the recursive solution for all pair shortest path problem [1.5]
iii. Write down the procedure of Min-Heapify. [3]
iv. Suppose that all characters in the pattern P are different. Show how to
accelerate Naïve String Matcher? [4]