0% found this document useful (0 votes)
14 views3 pages

DAA Questions 502040

Algorithms questions

Uploaded by

Prasad Kaviti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

DAA Questions 502040

Algorithms questions

Uploaded by

Prasad Kaviti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Topic_1: Introduction to Algorithms: Algorithm specification, Performance

Analysis.

1. Consider the following algorithm.

ALGORITHM Secret(A[0..n − 1])


//Input: An array A[0..n − 1] of n real numbers
minval ← A[0]; maxval ← A[0]
for i ← 1 to n − 1 do
if A[i] < minval
minval ← A[i]
if A[i] > maxval
maxval ← A[i]
return maxval − minval

a. What does this algorithm compute?


b. What is its basic operation?
c. How many times is the basic operation executed?
d. What is the efficiency class of this algorithm?
e. Suggest any possible improvement.

Topic_2: Divide and Conquer: The general method and Binary search.

2. Design a non-recursive binary search algorithm and specify the worst


case time complexity.

Topic_3: Finding maximum and minimum and Strassen’s Matrix


multiplication

3. Design an algorithm for finding straight forward maximum & minimum


and specify how this algorithm can be improved using Divide and
Conquer.

Topic_4: Merge sort, Quick sort and Selection

th
4. Apply kth smallest element finding algorithm to trace the k = 7 , for
elements {65, 70, 75, 80, 85, 60, 55, 50, 40} and justify why the
algorithm belongs to Divide and Conquer .

Topic_5: The Greedy Method: The general method, Knapsack problem

5. Given a set of items with different weights and Profits, describe the
steps involved in applying the greedy algorithm to determine the
maximum profit that can be carried in a Fractional knapsack with a
specific weight capacity. Include a discussion on how items are
selected and specify what factors are influence time complexity.
Topic_6: Job sequencing with deadlines and optimal storage on tapes.

6. Analyse the time complexity of the greedy job sequencing with


deadlines algorithm. Consider the steps of sorting the jobs by profit
and scheduling them based on their deadlines. What is the time
complexity, and how does it depend on the number of jobs?

Topic_7: Minimum cost spanning trees.

7. Discuss the time complexity of Prim's and Kruskal's algorithms for


finding the Minimum Cost Spanning Tree. What are the factors that
influence the time complexity of each algorithm, and how do they
compare?

Topic_8: Single source shortest paths.

8. Solve the following graph, single-source shortest-paths problem with


vertex a as the source:

Topic_9: Dynamic Programming: The general method and multistage graphs.

9. Find the shortest path from s to t for the below multi stage graph
using forward approach.
Topic_10: Optimal binary search trees
10. Define the purpose of OBST and Find the w (0,2), c (0,2) and r (0,2)
for the given details: Let n = 4 and (a 1, a2, a3, a4) = (do, if, int, while). Let P
(1: 4) = (3, 3, 1, 1) and q (0:4) = (2, 3,1,1,1).
Topic_11: Reliability design, all pairs shortest paths.

11. Solve the following graph, all-pairs shortest-paths problem with


vertex a as the source:

Topic_12: The Travelling Sales Person problem.

12. Describe the steps for solving TSP problem using dynamic
programming and mention the time complexity.

You might also like