ADA Endsem Merged
ADA Endsem Merged
OBcsoy
CEN-60º B.TECH. COMPUTER ENGINEERING
3rd YEAR, VI Semester, Examination, 2023
Analysis and Design of Algorithm
Paper Code: CEN-601
Maximum Marks: 60
Time: Three Hours
e-notation in detail. And find O, 2 and e-notation for the following [6]
Q1 (a) Explain the O, 2 and
function
CO1
() fn)=3*2M+7n'+&n+9
(i) fn) = 3n'+logn
(2+2+2=6]
Q1 (b) Solve the following Recurrences:
CO1
0 T(n) = 4T) +n'
following [3+3=6]
Breadth First search (BES)? Find the BES traversal from A for the
Q3 (a) () What is
CO3
graph. Show each step of BFSalgorithm.
(ii) Find the topological sort of the above directed acyclic graph.
Q3 (b) Given twelve activities along with their start and finish time as: [6]
CO3
Activity A1 A A3 A4 As A6 Az A8 Ag A10 A11 A12
start time 4 10 2 7 1 2 6 6
finish time 7 7 12 14 5 10 6 5 7 9
Compute schedule using greedy approach, where the largest number of activities takes
place. Explain and find out the complexity of greedy activity selector problem?
(c) Consider Six items along their respective weights and values [2+2+2=6]
Item TI T2 T3 T4 T5 T
Weight 8 7 4 2 3 2
value 80 42 56 40 60 32
Warshall's algorithm.
(ii) Explain the time and space complexity of Floyd
Screen. 1
https://jmitest.ucanapply.com/onlineexam/public/student/start-exam-set/eyJpdiI6Ilp6Rld5Ukpta1pLdEdOcjQ1cDhHY3c9PSIsInZhbHVlIjoiTzJrdlF2UEg1VDZsSHpEYkZ6azROV1l4d3BpRUZMS3htNFhjSDhPc21PST0i… 1/6
6/1/22, 10:01 AM CEN-601-ANALYSIS & DESIGN OF ALGORITHM
Chat
Send
Type your message here...
https://jmitest.ucanapply.com/onlineexam/public/student/start-exam-set/eyJpdiI6Ilp6Rld5Ukpta1pLdEdOcjQ1cDhHY3c9PSIsInZhbHVlIjoiTzJrdlF2UEg1VDZsSHpEYkZ6azROV1l4d3BpRUZMS3htNFhjSDhPc21PST0i… 2/6
6/1/22, 10:01 AM CEN-601-ANALYSIS & DESIGN OF ALGORITHM
Chat
Send
Type your message here...
https://jmitest.ucanapply.com/onlineexam/public/student/start-exam-set/eyJpdiI6Ilp6Rld5Ukpta1pLdEdOcjQ1cDhHY3c9PSIsInZhbHVlIjoiTzJrdlF2UEg1VDZsSHpEYkZ6azROV1l4d3BpRUZMS3htNFhjSDhPc21PST0i… 3/6
6/1/22, 10:01 AM CEN-601-ANALYSIS & DESIGN OF ALGORITHM
Chat
Send
Type your message here...
https://jmitest.ucanapply.com/onlineexam/public/student/start-exam-set/eyJpdiI6Ilp6Rld5Ukpta1pLdEdOcjQ1cDhHY3c9PSIsInZhbHVlIjoiTzJrdlF2UEg1VDZsSHpEYkZ6azROV1l4d3BpRUZMS3htNFhjSDhPc21PST0i… 4/6
6/1/22, 10:01 AM CEN-601-ANALYSIS & DESIGN OF ALGORITHM
Chat
Send
Type your message here...
Next
https://jmitest.ucanapply.com/onlineexam/public/student/start-exam-set/eyJpdiI6Ilp6Rld5Ukpta1pLdEdOcjQ1cDhHY3c9PSIsInZhbHVlIjoiTzJrdlF2UEg1VDZsSHpEYkZ6azROV1l4d3BpRUZMS3htNFhjSDhPc21PST0i… 5/6
6/1/22, 10:01 AM CEN-601-ANALYSIS & DESIGN OF ALGORITHM
Chat
Send
Type your message here...
https://jmitest.ucanapply.com/onlineexam/public/student/start-exam-set/eyJpdiI6Ilp6Rld5Ukpta1pLdEdOcjQ1cDhHY3c9PSIsInZhbHVlIjoiTzJrdlF2UEg1VDZsSHpEYkZ6azROV1l4d3BpRUZMS3htNFhjSDhPc21PST0i… 6/6
CEN-601 Roll No.…………………
B.TECH. COMPUTER ENGINEERING
rd
3 YEAR , VI Semester, Examination, 2020
Analysis and Design of Algorithm
Paper Code: CEN-601
Time: Three Hours Maximum Marks: 60
Instructions:
1. Write your Roll No. on the top immediately on receipt of this question paper
2. Attempt all questions by selecting any two parts from each question.
3. Assume any data suitably, if necessary only.
4. Marks are indicated against each question.
Q1 (a) Write short notes on O, Ω and θ asymptotic notations. Also calculate the O, Ω and [6]
θ for
CO1
T(n)=4*2n +n2+n
(ii)
(iii)
Q1 (c) (i) What do you understand by RAM Model of computation? Find the total primitive [3+3=6]
operation of the following algorithm.
CO1
Algorithm arraySumofEven(A, n)
Input: array A of n integers
Output: Sum of even element of A
Step 1: sum ←0
Step 2: for i ← 1 to n do
Step 3: if A[i] %2=0 then
Step 4: sum ←sum+A[i]
Step 5: return sum
CEN-601
____________________ __Dr. SHAHZAD ALAM__ ____________________
Moderators Paper Setter Code No.
Q2 (a) (i) Illustrate the operation of MAX-HEAPIFY (A, 3) on the following array. Show [3+3=6]
each steps of algorithms.
CO2
A={ 19, 15 , 18, 13, 10, 2, 5, 7, 12, 4, 8 }
(ii) When Does the Worst Case of Quicksort Occur? Derive the worst case time
complexity of Quick sort algorithm.
Q2 (c) Write the recurrence equation of Strassen’s algorithm for multiplying two matrices and [6]
find its complexity. Use Strassen’s algorithm to compute the product of two given
CO2
square matrices.
1 1 3 3
[ ] and [ ]
2 2 4 4
Q3 (a) (i) What is Breadth First search (BFS)? Find the Breadth First search (BFS) traversal [3+3=6]
from A for the following graph. Show each steps of BFS algorithm.
CO3
CEN-601
____________________ __Dr. SHAHZAD ALAM__ ____________________
Moderators Paper Setter Code No.
(ii) Find the topological sort of the following directed acyclic graph.
Q3 (b) Given nine activities along with their start and finish time as: [6]
CO3
Activity A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11
start time 11 2 1 7 6 8 5 3 5 2 3
finish time 11 12 3 8 10 11 9 8 7 6 5
Compute schedule using greedy approach, where the largest number of activities takes
place. Explain and find out the complexity of greedy activity selector problem?
Q3 (c) (i) Apply Kruskal’s algorithm to find Minimum Spanning Tree of the following graph. [3+3=6]
CO3 Also find its order of complexity.
CEN-601
____________________ __Dr. SHAHZAD ALAM__ ____________________
Moderators Paper Setter Code No.
(ii) Consider Six items along their respective weights and values
Item T1 T2 T3 T4 T5 T6
Weight 2 3 2 8 7 4
value 20 30 16 40 21 28
The capacity of knapsack W=14 .Find the solutions using 0/1 and fractional Knapsack
problem using greedy approach. Is there exists an optimal solution of 0/1 knapsack
problem? What is the complexity of 0/1 Knapsack problem?
Q4 (a) What is the characteristics of Dynamic Programming? Solve the Fibonacci series using [6]
CO4 dynamic programming with
(i) top down approach
(ii) bottom-up approach
Q4 (b) Evaluate an optimal order of multiplying 4 matrices A1, A2, A3, and A4 whose sequences [6]
of dimension is (2, 2, 3, 1, 2) using dynamic programming.
CO4
Q4 (c) Explain Longest Common Subsequence problem (LCS)? What is the complexity of [6]
LCS algorithm? Find the LCS of X and Y where
CO4
X= “ ANALYSIS ” and
Y=” ALGORITHM ”
Q5 (a) Explain string Matching algorithm with Finite Automata. Find all substring ‘abc’ in a [6]
CO5 string x=’acabbaabcbacabbabcbabccabab’ using Finite Automata string matching
algorithm.
Q5 (b) Explain the Horner’s rule. Calculate the total number of spurious and valid hits in the [6]
CO5 text T= 862346237846786127 when looking for the pattern P=23, by Rabin-Karp String
matcher. Assume the working modulo q=11.
Q5 (c) Write short notes on P class, NP class and NP complete problems. [6]
CO5
CEN-601
____________________ __Dr. SHAHZAD ALAM__ ____________________
Moderators Paper Setter Code No.
Department of Computer Engineering
Jamia Millia Islamia, New Delhi-110025
B.Tech 3rd Year (Semester -6) 2023
Subject: ADA (Analysis & Design of Algorithm)
Paper Code: CEN-601
Assignment
Q1 Write shorts notes on O, Ө and Ω Asymptotic notations. Give one example of each.
And solve the following :
(i) Prove that running Time T(n)=n3+20n+1 is O(n3)
(ii) Prove that running Time T(n)=n3+20n is Ω(n2)
n
Q2 Write the recurrence equation of Strassen’s algorithm for multiplying the matrix. Use
Strassen’s algorithm to compute the product to two given square matrix:
3 4 7 8
[ ] and [ ]
5 6 8 9
I= I1 , I 2 , I 3 , I 4 , I 5 , I 6 , I 7
W = 2,3,5,7,1,4,1
V = 10,5,15,7,6,18,3
The capacity of knapsack W=15. Find the optimal solution of the fractional knapsack
problem. What is the complexity of finding the solution of fractional knapsack problem?
Q4 What do understand by LCS problem? Find the longest common subsequences of X and
Y where
(i) X= “ABCDBCDC” and Y=” BCDCD”
(ii) X= “POLYNOMIAL” and Y= “ EXPONENTIAL”
Q5 Write the short notes on NP class, NP hard and NP complete problems? Give example
of each problem