0% found this document useful (0 votes)
10 views16 pages

ADA Endsem Merged

This document is an examination paper for B.Tech Computer Engineering students, focusing on the Analysis and Design of Algorithms. It includes various questions on algorithm complexity, data structures, sorting algorithms, dynamic programming, and graph theory. The exam consists of multiple questions where students are required to solve problems, explain concepts, and demonstrate their understanding of algorithms and their complexities.

Uploaded by

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

ADA Endsem Merged

This document is an examination paper for B.Tech Computer Engineering students, focusing on the Analysis and Design of Algorithms. It includes various questions on algorithm complexity, data structures, sorting algorithms, dynamic programming, and graph theory. The exam consists of multiple questions where students are required to solve problems, explain concepts, and demonstrate their understanding of algorithms and their complexities.

Uploaded by

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

Roll No.

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

Instructions: receipt of this question paper


No. on the top immediately on
1. Write your Roll parts from each question.
by selecting any two
2. Attempt all questions necessary only.
suitably, if
3. Assume any data against each question.
4. Marks are indicated

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'

(6) T(n) = 2T(Vn) +log'n


a) T(n) =T)+T()+ n
algorithm and also write its recurrence equation. (3+3-6]
Q1 (c) () Explain the complexity of binary search
CO1
(i) Find O(n)+2(n')+ O(n)=? Justify your answer.

following array. Show each [3+3-6]


Q2 (a) () Illustrate the operation of MAX-HEAPIFY (A, 2)on the
steps of algorithms.
C02 A={ 14, 10, 13, 8, 5, 1, 2, 3, 7, 4, 6}
operation of BUILD
(ii) What is the complexity of BUILD-MAX-HEAP? Illustrate the
MAX-HEAP on following array A.
A= {14, 1I, 7, 12, 10, 8, 22, 9, 69 }
Multiplication algorithm using Divide and
Q2 (b) () Discuss the complexity of Large Integer divide and conquer approach.
CO2 Conquer Approach. Multiply 2l and 12 using on the
character after applyingthe quick sort
(ii) What will be the final position of M
following array(Assumefirst element as pivot element).
MACHINELEARNING
[6]
for multiplying two matrices and find
algorithm
Q2 (c) Write the recurrence cquation of Strassen''s compute the product of two given square
its complexity. Use Strassen's algorithm to
CO2
matrices.

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

The capacity of knapsack W=14 .Find the solutions using


() 0/1Knapsack problem using greedy approach.
(i) fractional Knapsack problem using greedy approach.
(ii) 0/1 Knapsack problem using Branch and Bound
[1+3+2=6]
Q4 (2) (i) What are the limitations of dynamic programming?
CO4
approach using
(i) Solve the Fibonacci series using dynamic programming with top down
memorization.

Warshall's algorithm.
(ii) Explain the time and space complexity of Floyd

A4 whose sequences of [6]


matrices Al, Az, A3, and
Q4 (b) Evaluate an optimal order of multiplying 4programming.
dimension is (1, 2, 3, 1,2) using dynanic
C04
Longest Comrnun Subsequence prablem (LCS)? What is the complexity of LCS
Q4 (c) Explain
ofX and Y where
algorithm? Find the LCS
CO4
X= 'CONQUER' and Y= QUARREL'

substring 'bac' in a string [6]


05 (a) Explain string Matching algorithm with Finite Automata. Find all
x='acabbaabcbaccabbaccbabccabab' using Finite Automata string matching algorithm.

b) Explain the Horner's rule. Calculate the total number of


spurious and valid hits in the text [6]
08
T= 78612 786787782346237846 when looking for the pattern P=86, by Rabin-Karp String
CO5
matcher. Assume the working modulo g=11.
0s (e) Write shorts notes on P class, NP class and NP complete problems. What is the relationship {6]
among P, NP and NP-complete problems
CO5
6/1/22, 10:01 AM CEN-601-ANALYSIS & DESIGN OF ALGORITHM

Visited 0 / 3 Not Visited 3 Review 0 Time Left : 3 hours 58 minutes 38 seconds

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

Q1 (b) Solve the following Recurrences: [2+2+2=6]


CO1
(i) 𝑛
𝑇(𝑛) = 4𝑇 ( ) + 𝑛
2

(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

(ii) Explain the complexity of binary search algorithm.

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) What is the complexity of BUILD-MAX-HEAP? Illustrate the operation of


BUILD-MAX-HEAP on following array A.
A= {17, 15, 13, 27, 14, 74, 19, 16, 12 }

Q2 (b) (i) Consider following list of elements as [3+3=6]


14, 12, 16, 15, 45, 25, 17, 11
CO2
Sort the above list using Merge sort and derive the best and worst case time
complexity of Merge sort algorithm.

(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

Q3 Consider 7 items along their respective weights and values

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

NOTE:1. Assignment should be handwritten


2. LAST DATE of Assignment is 28 April-2023

You might also like