0% found this document useful (0 votes)
50 views8 pages

Daapyq

ll

Uploaded by

Aakash Pandey
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)
50 views8 pages

Daapyq

ll

Uploaded by

Aakash Pandey
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/ 8

Printed Page: 1 of 2

Subject Code: KCS503


0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

B. TECH.
(SEM-V) THEORY EXAMINATION 2020-21
DESIGN AND ANALYSIS OF ALGORITHM
Time: 3 Hours Total Marks: 100
Note: 1. Attempt all Sections. If require any missing data; then choose suitably.
SECTION A

1. Attempt all questions in brief. 2 x 10 = 20


Qno. Question Marks CO
a. What is recurrence relation? How is a recurrence solved using master’s 2
theorem?
b. What is asymptotic notation? Explain Omega (Ω) notation? 2
c. Write down the properties of binomial tree. 2
d. Differentiate Backtracking algorithm with branch and bound algorithm. 2
e. Solve the recurrence T (n) = 4T(n/2) + n2 2
f. Explain Fast Fourier Transform in brief. 2
g. Write an algorithm for naive string matcher? 2
h. Explain searching technique using divide and conquer approach. 2
i. Explain Skip list in brief. 2

P
0Q
j. Explain how algorithms performance is analyzed? 2

1
SECTION B

13
29

2.
2. Attempt any three of the following:
0E

24
Qno. Question Marks CO
P2

5.
a. Write an algorithm for counting sort? Illustrate the operation of counting 10
_Q

.5
sort on the following array: A={4, 0, 2, 0, 1, 3, 5, 4, 1, 3, 2, 3} 17
b. Show the results of inserting the keys F, S, Q, K, C, L, H, T, V, W, M, 10
TU

R, N, P, A, B, X, Y, D, Z, E in order into an empty B-tree. Use t=3,


|1

where t is the minimum degree of B- tree.


AK

c. Discuss greedy approach to an activity selection problem of scheduling 10


4 7

several competing activities. Solve following activity selection problem


8:

S = {A1, A2, A3, A4, A5, A6, A7, A8, A9, A10}
:3

Si = {1, 2, 3, 4, 7, 8, 9, 9, 11, 12} Fi = {3, 5, 4, 7, 10, 9, 11, 13, 12, 14}


09

d. What is sum of subset problem? Draw a state space tree for Sum of 10
subset problem using backtracking? Let n=6, m=30 and w [1:6] = {5, 10,
1

12, 13, 15, 18}


02

e. Write KMP algorithm for string matching? Perform the KMP algorithm 10
2

to search the occurrences of the pattern abaab in the text string


b-

abbabaabaabab.
Fe

SECTION C
7-

3. Attempt any one part of the following:


|2

Qno. Question Marks CO


a. Solve the following recurrence relation: 10
i. T (n) = T (n-1) + n4
ii. T (n) = T (n/4) + T (n/2) + n2
b. Write an algorithm for insertion sort. Find the time complexity of 10
Insertion sort in all cases.

1|Page
AKTU_QP20E290QP | 27-Feb-2021 09:38:47 | 117.55.242.131
Printed Page: 2 of 2
Subject Code: KCS503
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

4. Attempt any one part of the following:


Qno. Question Marks CO
a. Write an algorithm for insertion of key in the Red-Black Tree. Discuss 10
the various cases for insertion of key in red-black tree for given sequence
of key in an empty red-black tree- 5, 16, 22, 25, 2, 10, 18, 30, 50, 12, 1.
b. Explain and write an algorithm for union of two binomial heaps and also 10
write its time complexity?

5. Attempt any one part of the following:


Qno. Question Marks CO
a. Define minimum spanning tree (MST). Write Prim’s algorithm to 10
generate a MST for any given weighted graph. Generate MST for the
following graph using Prim’s algorithm.

P
0Q

1
13
29

2.
0E

b. Explain Dijkstra’s algorithm to solve single source shortest path problem 10

24
with suitable example.
P2

5.
_Q

.5
6. Attempt any one part of the following: 17
TU

Qno. Question Marks CO


|1

a. What is travelling salesman problem (TSP)? Find the solution of 10


AK

following TSP using dynamic programming.


4 7

0 1 15 6
8:

2 0 7 3
:3

9 6 0 12
09

10 4 8 0
1
02

b. Discuss n queen’s problem. Solve 4 queen’s problem using backtracking 10


method?
2
b-
Fe

7. Attempt any one part of the following:


7-

Qno. Question Marks CO


|2

a. Write short notes on following: 10


(i.) Randomized algorithm.
(ii.) NP- complete and NP hard.
b. What is approximation algorithm? Explain set cover problem using 10
approximation algorithm.

2|Page
AKTU_QP20E290QP | 27-Feb-2021 09:38:47 | 117.55.242.131
Printed Page: 1 of 2
Subject Code: KCS503
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

B. TECH.
(SEM V) THEORY EXAMINATION 2021-22
DESIGN AND ANALYSIS OF ALGORITHM
Time: 3 Hours Total Marks: 100
Note: 1. Attempt all Sections. If require any missing data; then choose suitably.
2. Any special paper specific instruction.

SECTION A

1. Attempt all questions in brief. 2 x 10 = 20


a. How analyze the performance of an algorithm in different cases?
b. Derive the time complexity of Merge sort.
c. Explain left rotation in RB tree.
d. Write down the properties of Fibonacci Heap.
e. Explain Greedy programming in brief.
f. What do you mean by convex hull?
g. Write down the Floyd Warshal algorithm.
h. Explain Branch and Bound method in brief.
i. Explain Randomized algorithm in brief.
j. Explain NP-complete and NP-Hard.

1
90

13
SECTION B
_2

2.
2. Attempt any three of the following: 10 x 3 = 30
1P

24
a. Solve the recurrence

5.
2O

i) T (n) =3T (n/4) + cn2 using recursion tree method.


ii)
.5
T (n) = n + 2T (n/2) using Iteration method. (Given T(1)=1)
P2

17
b. What is Binomial Heap? Write down the algorithm for Decrease key operation
Q

|1

in Binomial Heap also write its time complexity.


c. Write and explain the Kruskal algorithm to find the Minimum Spanning Tree of
17

a graph with suitable example.


9:

d. What is N queens problem? Draw a state space tree for 4 queens problem using
backtracking.
:5

e. Write Rabin Karp string matching algorithm. Working modulo q=11, how
08

many spurious hits does the Rabin karp matcher in the text T=
21

3141592653589793, when looking for the pattern P=26.


20

SECTION C
-
ec

3. Attempt any one part of the following: 10 x 1 = 10


D

(a) Write Merge sort algorithm and sort the following sequence {23, 11, 5, 15, 68,
0-

31, 4, 17} using merge sort.


|3

(b) What do you understand by stable and unstable sorting? Sort the following
sequence {25, 57, 48, 36, 12, 91, 86, 32} using heap sort.

4. Attempt any one part of the following: 10 x 1 = 10


(a) Discuss the various cases for insertion of key in red-black tree for given
sequence of key in an empty red-black tree- {15, 13, 12, 16, 19, 23, 5, 8}.
(b) What is skip list? Explain the Search operation in Skip list with suitable

QP22O1P_290 | 30-Dec-2021 08:59:17 | 117.55.242.131


Printed Page: 2 of 2
Subject Code: KCS503
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

example also write its algorithm.

5. Attempt any one part of the following: 10 x 1 = 10


(a) What is Knapsack problem? Solve Fractional knapsack problem using greedy
programming for the following four items with their weights w = {3, 5, 9, 5}
and values P = {45, 30, 45, 10} with knapsack capacity is 16.
(b) Write down the Bellman Ford algorithm to solve the single source shortest path
problem also write its time complexity.

6. Attempt any one part of the following: 10 x 1 = 10


(a) What is travelling salesman problem (TSP)? Find the solution of following TSP
using Branch & Bound method
0 20 30 10 11
15 0 16 4 2
3 5 0 2 4
19 6 18 0 3
16 4 7 16 0

1
(b) Explain the method of finding Hamiltonian cycles in a graph using
90

13
backtracking method with suitable example.
_2

2.
1P

24
7. Attempt any one part of the following: 10 x 1 = 10

5.
2O

(a) Write and explain the algorithm to solve vertex cover problem using

.5
approximation algorithm.
P2

17
(b) Explain and Write the Knuth-Morris-Pratt algorithm for pattern matching also
write its time complexity.
Q

|1
17
9:
:5
08
21
- 20
ec
D
0-
|3

QP22O1P_290 | 30-Dec-2021 08:59:17 | 117.55.242.131


Printed Pages: 02 Sub Code:KCS-503

Paper Id: 2 3 1 2 3 6 Roll No.

B.TECH.
(SEM V) THEORY EXAMINATION 2022-23
DESIGN & ANALYSIS OF ALGORITHM
Time: 3 Hours Total Marks: 100
Note: Attempt all Sections. If you require any missing data, then choose suitably.

SECTION A

1. Attempt all questions in brief. 2x10 = 20


(a) Discuss the basic steps in the complete development of an algorithm.
(b) Explain and compare best and worst time complexity of Quick Sort.
(c) Discuss Skip list and its operations.
(d) Discuss the properties of binomial trees.
(e) Illustrate the applications of Graph Coloring Problem
(f) Define principle of optimality.
(g) Differentiate Backtracking and Branch and Bound Techniques.
(h) Discuss backtracking problem solving approach.
(i) Define NP, NP hard and NP complete. Give example of each.

2
(j) Explain Randomized algorithms.
90

13
_2

2.
SECTION B
P1

24
2. Attempt any three of the following: 10x3 = 30

5.
3D

(a) Explain Merge sort algorithm and sort the following sequence {23, 11,

.5
P2

5, 15, 68,31, 4, 17} using merge sort.


17
(b) What are the various differences in Binomial and Fibonacci Heap?
Q

|1
Explain.
(c) Prove that if the weights on the edge of the connected undirected graph
1

are distinct then there is a unique Minimum Spanning Tree. Give an


:5

example in this regard. Also discuss Kruskal’s Minimum Spanning Tree


20

in detail.
(d) Discuss LCS algorithm to compute Longest Common Subsequence of
:
13

two givenstrings and time complexity analysis.


(e) Explain and Write the Naïve-String string matching algorithm:
3

Suppose the given pattern p= aa b and given text T = a c a a b c.


02

Apply Naïve-String Matching algorithm on above Pattern (P) and Text


-2

(T) to find the number of occurrences of P in T.


01

SECTION C
0-
|1

3. Attempt any one part of the following: 10x1 = 10


(a) Examine the following recurrence relation:
(i) T (n) = T (n-1) + n 4
(ii) T (n) = T (n/4) + T (n/2) + n 2
(b) Explain algorithm for counting sort. Illustrate the operation of counting
sort on the following array: A={0,1,3,0,3,2,4,5,2,4,6,2,2,3}.

4. Attempt any one part of the following: 10 *1 = 10

QP23DP1_290 | 10-01-2023 13:20:51 | 117.55.242.132


(a) Discuss the various cases for insertion of key in red-black tree for given
sequence of key in an empty red-black tree- {15,13,12,16,19,23,5,8}. Also
show that a red-black tree with n internal nodes has height at most 2lg(n+1).
(b) Explain and write an algorithm for union of two binomial heaps and write its
time complexity.

5. Attempt any one part of the following: 10*1 = 10


(a) Explain “greedy algorithm” Write its pseudo code to prove that fractional
Knapsack problem has a greedy-choice property.
(b) What are single source shortest paths? Write down Dijkstra’s algorithm for it.

6. Attempt any one part of the following: 10*1 = 10


(a) What is the sum of subsets problem? Let w={5,7,10,12,15,18,20} and m=35.
Find all possible subsets of w that sum to m using recursive backtracking
algorithm for it. Draw the portion of the state-space tree that is generated.
(b) Illustrate n queen’s problem. Examine 4 queen’s problem using back tracking
method.

7. Attempt any one part of the following: 10*1 = 10


(a) What is string matching algorithm? Explain Rabin-Karp method with examples.
(b) Explain approximation algorithm. Explore set cover problem using
approximation algorithm.

2
90

13
_2

2.
P1

24
5.
3D

.5
P2

17
Q

|1
1
:5
: 20
13
3
02
-2
01
0-
|1

QP23DP1_290 | 10-01-2023 13:20:51 | 117.55.242.132

You might also like