Ada See
Ada See
BCS401
USN I B Y2
2A1oo 2 NATI:N
Note:
Answer FIVE full questions,choosing ONE full question from each module.
2. Assume suitably any missing Data.
Q. No Module -1 Marks CO, RBT
What are the key properties that define an algorithm? Describe a situation wherc
la. understanding the problem is the most challenging part of solving a problem COI, L2
algorithmically. How would you approach solving such a problem?
lb.
Explain the notion of algorithm. Design Euclid's algorithm for computing GCD(m, n). 10 CO1, L3
Find GCD(60, 24) using Euclid's algorithm.
OR
Define time efficiency and space eficiency in the context of algorithm analysis. Explain
2a the concept of worst-case, best-case, and average-case efficiency in algorithm analysis. 10 CO1, L2
Provide examples to illustrate each scenario.
Write a pseudo code function to implement the algorithm for finding the maximum
2b number in a list of integers. 05 CO1, L3
Module-2
3a.
Describe a Decrease and Conquer algorithm to perform Topological Sorting on a 10 CO1, LI
Directed Acyclic Graph (DAG).
Compare the complexity oflinear search and binary search. Deseribe how Divide and 10 CO1, L2
3b. Conquer approach is used in implementing binary search.
OR
Illustrate a Divide andConquer algorithm tofind the maximum and minimum elements
4a.
in an array. Analyse its time complexity, Provide a numerical example. 10 CO2, L2
4b. Explain the general method of Divide and Conquer algorithm. Solve the recurrence 10 CO2, L3
equation T(n) = aT(n/b) + f(n) using the Master's theorem.
Module-3
Given the weights and profits of N items, in the form of {profit, weight} put these
Sa. items in aknapsack of capacity W to get the maximum total profit in the knapsack 10 CO3, L3
problem using Greedy algorithm. Write the algorithm and show step by step procedure
forthe nput: arrl) =f(60, 101. (100, 20). (120, 30}. W= 50, Output: 240
Page 1 of4
BCS401
Construct the frequency table and Huffinan Tree for the string: "a fast runner nced
Sb. never be afraid of the dark. Explain the step-by-step construction method. 10
CO4, L3
OR
Consider the following tasks Table Iwith their dcadlines and profits. Schedule thetasks
in such a way that they produce maximum profit afer being exccuted.
Table 1
S. No. 2 3 4
10
6a. Jobs JI J2 J3 J4 J CO3, L3
Deadlincs 2 4
Profits 20 60 40 100 80
Write algorithmto generate minimum cost spanning tree using Prim's algorithim and
show step by step procedure of Prim's algorithm for the following graph (Fig-l)
10 28
6b. 10 CO4, L3
14
16
24
25
18
Fig-1 22 12
3)
Module -4
Design Belman-Ford algorithm. Apply this algorithmto findshortest path distance from CO4, L3
source S to allother vertices in Fig-2.
5
2
7a 10
3
7
Fig-2
Page 2 of4
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
BCS401
Illustrate a Dynamic Programming solution to find the optimal tour that visits CO4, L3
cach city exactly once and retuns to the starting city for the following graph Fig
3.
20
7b. 10 15 10
30
Fig-3.
OR
Construct the Optimal binary search tree for the following data: CO4, L2
8a. Key A B C D 10
programming.
Table 2
()8
IOb.
Fig-4
ii) NP had problem (04
1Oc. Explain i) NP Complete problem
Course Outcomes (COs):
COs A theend
Analyze of thealgorithms,
various course, theslate
N(udent wilbe able
the cficicncy usingto asymptotic notations and nnathenatically represcnt the complexity of the algorithm.
CO-1
C0-2 Explain the clusses P, NI, andNP-Complete and be able to prove that acertain problem is NP-Complete.
Explain inmportant alporithmic desiu paradignns (divido-and-conquer, greedy method, dynamic-propramming md Backtracking) and apply
(03
when analyoritbnie design situntion calls lor it.
CO-4 Ayply anLI-alonithn using ypropriate
Remenmbering design strategiesL3-Applying
L2-Understanding for problem solving.
L4- Analyzing L5 - Evaluating L6 -Creating
"Satisfaction lles in the ffort, not in the atainment, full effort is full victory"