Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

daa sem 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

.

Printed Page:-04 Subject Code:- ACSE0401/ACSEH0401


Roll. No:

NOIDA INSTITUTE OF ENGINEERING AND TECHNOLOGY, GREATER NOIDA


(An Autonomous Institute Affiliated to AKTU, Lucknow)
B.Tech
SEM: IV - THEORY EXAMINATION - (2023 - 2024)
Subject: Design and Analysis of Algorithm
Time: 3 Hours Max. Marks: 100
General Instructions:
IMP: Verify that you have received the question paper with the correct course, code, branch etc.
1. This Question paper comprises of three Sections -A, B, & C. It consists of Multiple Choice
Questions (MCQ’s) & Subjective type questions.
2. Maximum marks for each question are indicated on right -hand side of each question.
3. Illustrate your answers with neat sketches wherever necessary.
4. Assume suitable data if necessary.
2 4
5. Preferably, write the answers in sequential order.

2 0
6. No sheet should be left blank. Any written material after a blank sheet will not be
evaluated/checked.

1. Attempt all parts:-


SECTION A

A Y 20

1-a.

(a) backtracking
. M
Merge sort uses which of the following technique to implement sorting? (CO1) 1

E G
(b) greedy algorithm
(c) dynamic programming

1-b.
R
(d) divide and conquer

The worst case complexity for insertion sort is (CO1) 1

(a) O(n)
(b) O(log n)
(c) O(nlog n)
(d) O(n2)

1-c. What is the special property of red-black trees and what root should always 1
be? (CO2)

(a) color which is either red or black and root should always be black color
only

.
Page 1 of 4
.
(b) height of the tree
(c) pointer to next node
(d) a color which is either green or black

1-d. Number of node at depth i in binomial heap Bk. (CO2) 1

(a) n2
(b) n3
(c) kci
(d) 2k

1-e. Time complexity of Depth First Search algorithm is: (CO3) 1

(a) O(V lg E)
(b) O(E+V)
(c) O(lg V)

1-f.
(d) O(E lg E)

We can solve Single-Source shortest path problem using (CO3)


2 4 1

(a) Kruskal's Algorithm


(b) Prim's Algorithm
2 0
(c) Dijkstra's Algorithm
(d) Flyod-Warshal Algorithm
A Y
1-g.
(CO4)

. M
Depth First Search is equivalent to which of the traversal in the Binary Trees? 1

G
(a) Pre-order Traversal
(b) Post-order Traversal

R E
(c) Level-order Traversal
(d) In-order Traversal

1-h. Travelling salesman problem is an example of.....(CO4) 1

(a) Dynamic Algorithm


(b) Greedy Algorithm
(c) Recursive Approach
(d) Divide & Conquer

1-i. Basic principle in Rabin Karp algorithm: (CO5) 1

(a) Hashing
(b) Sorting
(c) Augmenting

.
Page 2 of 4
.
(d) Dynamic Programming

1-j. What does NP stands for in complexity classes’ theory? (CO5) 1

(a) Non polynomial


(b) Non-deterministic polynomial
(c) Both (a) and (b)
(d) None of the mentioned

2. Attempt all parts:-

2.a. Write the difference between an Algorithm and a Program .(CO1) 2

2.b. Define Binomial heap.(CO2) 2

2.c. Write the procedure to relax an edge (u ,v). (CO3) 2

2.d. Explain N-Queen problem with its complexity? (CO4) 2

2.e. Compare NP-hard and NP-completeness. (CO5) 2

3. Answer any five of the following:-


SECTION B

2 4 30

3-a.

3-b.
Explain asymptotic notations with example.(CO1)

2 0
Solve the following recurrence relation using master's theorem (CO1)
6

3-c.
T(n) = 7T(n/2) + 3n2 + 2

A Y
Insert the nodes 15, 13, 12, 16, 19, 23, 5, 8 into empty Red Black Tree (CO2) 6

3-d.
example for the same. (CO2)
. M
Explain the algorithm to delete a given element in a binomial Heap. Give an 6

3.e.

EG
Write algorithm to solve fractional knapsack problem. For the given items find
the optimal solution: I:, W: <60, 20, 40, 30, 50>, P: <120, 100, 90, 90, 50>,
capacity of knapsack = 100. (CO3)
6

3.f.
R
Write an algorithm of Sum-of-subset problem using backtracking approach.
Find all possible solution for following instances using same if m=30 and S=<
6

1,2,5,7,8,10,15,20,25>. (CO4)

3.g. Define Hamiltonian path? Generalize that Hamiltonian cycle is an undirected 6


graph. (CO5)

SECTION C 50

4. Answer any one of the following:-

4-a. Solve the following recurrences using master method. (CO1) 10


(i) T(n) = 4 T(n/2) + n2
(ii) T(n) = 2T(n/2) + n2 / lg2 n
(iii) T(n) = 2T(n/3) + n2
.
Page 3 of 4
.
4-b. Write the algorithm of Counting sort? Sort the following elements using 10
Counting sort algorithm < 4, 8, 4, 2, 9, 9, 6, 2, 9> (CO1)

5. Answer any one of the following:-

5-a. Write algorithm for extracting minimum element in a fibonacci heap. Also give 10
example? (CO2)

5-b. Insert the following element in an initially empty RB-Tree. 12, 9, 81, 76, 23, 43, 10
65, 88, 76, 32, 54. Now Delete 23 and 81. (CO2)

6. Answer any one of the following:-

6-a. Explain data compression techniques? Write algorithm to implement Huffman 10


code and analyze the algorithm step by step. Find the Huffman code for the
character of given text file Character Frequency:<45, 25, 20, 5, 10, 15> (CO3)

6-b. How Divide and Conquer technique is used to solve a problem efficiently? 10
Explain the use of pivot element in Quick sort. Write the algorithm for quick
sort.

7. Answer any one of the following:-


2 4
7-a.

2 0
Explain 8 queen problem. Make a state space tree and find the solution for 8
queens problem.(CO4)
10

7-b.

A Y
Solve the instance of 0/1 knapsack problem using dynamic Programming : n =
4, M = 25, (P1, P2, P3 P4) = (10, 12, 14, 16), (W1, W2, W3, W4) = (9, 8, 12, 14).
(CO4)
10

8. Answer any one of the following:-

. M
G
8-a. Discuss in detail about the class P, NP, NP-hard and NP-complete problems. 10
Give examples for each class. (CO5)

8-b.

R E
Explain the string matching algorithm for finding the pattern on a text and
analyze the algorithm. (CO5)
10

.
Page 4 of 4

You might also like