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

Time: 3 Hours Total Marks: 70

1. The document is a past exam paper for a Design and Analysis of Algorithms course. It contains 7 sections with multiple choice and long answer questions. 2. Section A contains 14 marks worth of short answer questions defining and explaining key algorithm concepts like growth rates, properties of B-trees, dynamic programming, graph representations, approximation algorithms, and sorting algorithm stability. 3. Section B contains 3 out of 5 long answer questions worth 7 marks each, involving solving recurrences, binary search tree insertion, minimum spanning trees, and heap sort illustration. 4. Section C contains 1 out of 3 long answer questions worth 7 marks, involving convex hull problems, Dijkstra's algorithm, backtracking, or

Uploaded by

Tushar Gupta
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)
100 views16 pages

Time: 3 Hours Total Marks: 70

1. The document is a past exam paper for a Design and Analysis of Algorithms course. It contains 7 sections with multiple choice and long answer questions. 2. Section A contains 14 marks worth of short answer questions defining and explaining key algorithm concepts like growth rates, properties of B-trees, dynamic programming, graph representations, approximation algorithms, and sorting algorithm stability. 3. Section B contains 3 out of 5 long answer questions worth 7 marks each, involving solving recurrences, binary search tree insertion, minimum spanning trees, and heap sort illustration. 4. Section C contains 1 out of 3 long answer questions worth 7 marks, involving convex hull problems, Dijkstra's algorithm, backtracking, or

Uploaded by

Tushar Gupta
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

Printed Pages: 02 Subject Code: RCS502

Paper Id: 110502 Roll No:

B TECH
(SEM V) THEORY EXAMINATION 2018-19
DESIGN & ANALYSIS OF ALGORITHMS
Time: 3 Hours Total Marks: 70
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 7 = 14


a. Rank the following by growth rate:
n, 2lg √n, log n, log (logn), log2n, (lgn)lgn, 4, (3/2)n, n!
b. Prove that if n>=1, then for any n-key B-Tree of height h and minimum degree t >=2, h<=
log t ((n +1)/2).
c. Define principal of optimality. When and how dynamic programming is
applicable.
d. Explain application of graph coloring problem.
e. Compare adjacency matrix and linked Adjacency lists representation of a Graph with
suitable example/diagram.
f. What are approximation algorithms? What is meant by P (n) approximation algorithms?
g. What do you mean by stability of a sorting algorithm? Explain its application.
SECTION B

2. Attempt any three of the following: 7 x 3 = 21


a. Use a recursion tree to give an asymptotically tight solution to the recurrence
T(n) = T(αn) + T((1 - α)n) + cn, where α is a constant in the range 0 <α< 1 and
c> 0 is also a constant.

b. Define BNP, NP hard and NP Complete Problems. Prove that Travelling Salesman
Problem is NP-Complete.

c. Consider the weights and values of items listed below. Note that there is only one unit of
each item. The task is to pick a subset of these items such that their total weight is no
more than 11 Kgs and their total value is maximized. Moreover, no item may be split. The
total value of items picked by an optimal algorithm is denoted by Vopt. A greedy
algorithm sorts the items by their value-to-weight ratios in descending order and packs
them greedily, starting from the first item in the ordered list. The total value of items
picked by the greedy algorithm is denoted by Vgreedy. Find the value of Vopt − Vgreedy

Item I1 I2 I3 I4
W 10 7 4 2
V 60 28 20 24
d. Insert the following keys in a 2-3-4 B Tree:
40, 35, 22, 90, 12, 45, 58, 78, 67, 60 and then delete key 35 and 22 one after other.
e. Prove that if the weights on the edge of the connected undirected graph are distinct then
there is a unique Minimum Spanning Tree. Give an example in this regard. Also discuss
Prim’s Minimum Spanning Tree Algorithm in detail.
SECTION C
3. Attempt any one part of the following: 7x1=7
(a) The recurrence T (n) = 7T (n/3) + n2 describes the running time of an algorithm A.
Another competing algorithm B has a running time of S (n) = a S (n/ 9) + n2. What is the
smallest value of ‘a’ such that A is asymptotically faster than B.?

(b) How will you sort following array A of elements using heap sort:
A = (23, 9, 18, 45, 5, 9, 1, 17, 6).

4. Attempt any one part of the following: 7x1=7


(a) Explain the different conditions of getting union of two existing binomial
Heaps. Also write algorithm for union of two Binomial Heaps. What is its complexity?

(b) Insert the elements 8, 20, 11, 14, 9, 4, 12 in a Red-Black Tree and delete 12, 4, 9, 14
respectively.

5. Attempt any one part of the following: 7x1=7


(a) When do Dijkstra and the Bellman-Ford algorithm both fail to find a shortest path?Can
Bellman ford detect all negative weight cycles in a graph?Apply Bellman Ford Algorithm
on the following graph:

(b) Given an integer x and a positive number n, use divide & conquer approach to write a
function that computes xnwith time complexity O (logn).

6. Attempt any one part of the following: 7x1=7


(a) Solve the Subset sum problem using Backtracking, where n=4, m=18, w [4] = {5, 10, 8,
13}
(b) Give Floyd War shall algorithm to find the shortest path for all pairs of vertices in a
graph. Give the complexity of the algorithm. Explain with example.

7. Attempt any one part of the following: 7x1=7


(a) What is the application of Fast Fourier Transform (FFT)? Also write the recursive
algorithm for FFT.
(b) Give a linear time algorithm to determine if a text T is a cycle rotation of another string T’.
For example, ‘RAJA’ and ‘JARA’ are cyclic rotations of each other.
www.aktuonline.com

Printed pages: 01 Sub Code: ECS502


Paper Id: 1 0 3 6 Roll No:
B TECH
(SEM V) THEORY EXAMINATION 2017-18
DESIGN AND ANALYSIS OF ALGORITHMS
Time: 3 Hours Total Marks: 100
Notes: Attempt all Sections. Assume any missing data.
SECTION-A
1. Define/Explain the following: (2*10=20)
(a)Difference between Complete Binary Tree and Binary Tree?
(b)Difference between Greedy Technique and Dynamic programming.
(c) Solve the following recurrence using Master method:
T (n) = 4T (n/3) + n2
(d)Name the sorting algorithm that is most practically used and also write its Time Complexity.
(e) Find the time complexity of the recurrence relation
T(n)= n +T(n/10)+T(7n/5)
(f) Explain Single source shortest path.
(g) Define Graph Coloring.
(h)Compare Time Complexity with Space Complexity.
(i) What are the characteristics of the algorithm?
(j) Differentiate between Backtracking and Branch and Bound Techniques.
SECTION-B
2. Attempt any three of the following: (10×3=30)
www.aktuonline.com

(a)Solve the following By Recursion Tree Method


T(n)=n+T(n/5)+T(4n/5)
(b)Insert the following information F,S,Q,K,C,L,H,T,V,W,M,R,N,P,A,B,X,Y,D,Z,E,G,I.
Into an empty B-tree with degree t=3.
(c) What is Minimum Cost Spanning Tree? Explain Kruskal’s Algorithm and Find MST
of the Graph. Also write its Time-Complexity

(d) What is Red-Black tree? Write an algorithm to insert a node in an empty red-black tree
explain with suitable example.

(e) Explain HEAP-SORT on the array. Illustrate the operation of HEAP-SORT on the array
A= {6, 14, 3, 25, 2, 10, 20, 7, 6}

SECTION C
3. Attempt any one part of the following: (10 x 1=10)
(a) Explain Convex –Hull problem.
(b) Find the shortest path in the below graph from the source vertex 1 to all other vertices
by using Dijkstra’s algorithm.

www.aktuonline.com
www.aktuonline.com

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

(a) What is backtracking? Discuss sum of subset problem with the help of an
example.
(b) Write down an algorithm to compute Longest Common Subsequence
(LCS) of two given strings and analyze its time complexity.

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

(a) The recurrence T (n) =7T (n/2) +n 2 describe the running time of an algorithm A.A
competing algorithm A has a running time of T’ (n) =aT’ (n/4) +n 2 .What is the largest
integer value for a A’ is asymptotically faster than A?
www.aktuonline.com

(b) Discuss the problem classes P, NP and NP –complete .with class relationship.

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


(a) Explain properties of Binomial Heap in .Write an algorithm to perform uniting
two Binomial Heaps. And also to find Minimum Key.

(b) Given the six items in the table below and a Knapsack with Weight 100, what is the
solution to the Knapsack problem in all concepts. I.e. explain greedy all approaches and find
the optimal solution

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


(a) Compute the prefix function π for the pattern P= a b a c a b using KNUTH-
MORRIS –PRATT Algorithm. Also explain Naïve String Matching algorithm.

(b) Explain Approximation and Randomized algorithms.

www.aktuonline.com
ltr TL
I

www.aktuonline.com

Printed Pages - 3 NCS.5O1

(Following Paper ID and Roll No. to be filled in your


Answer Books)

Roll No.

B.TECH.

Regular Theory Examination (Odd Sem - Y 20L6'17

DE SIGN AND ANALYSIS OF ALGORITHM


Time:3 Hours Max. Marks : 100

Section - A

1. Attempt all parts. Atl parts carry equal marks. Write


answer of each part in short. (10x2:20)
a) List out the disadvantages of divide and conquer
www.aktuonline.com

algorithm.

b) What are the fundamental steps involved in


algorithmic probl em solving?

c) Write recursive function to find nth Fibonacci


number.

d) Define Binaryheap.

e) Briefly explain the Prim's algorithm.

f) Define principle of optimality.

s0tnu20r5n3260 (1)
lP.T.O.

www.aktuonline.com
7 f, www.aktuonline.com

NCS-501
s) Write the names of various design techniques of
algorithrn.

h) Differences between branch & bound and


backtracking technique.

i) What is the running time complexity of 8 queenls


problem?

j) DefineP,NPandNPcompleteindecisionproblem.

Section - B

Attempt any five questions from this section.


(5x10:50)
, Explain the concepts of quick sort method and analyze
its complexity with suitable example.

3. Explain the concept of merge sort with example.


www.aktuonline.com

4. Insertttre nodes 15, 13, 12, 16, 1g,23,5, 8 in empty Red


Black Tree and delete in the reverse order of insertion.

5. Write short note on Dijkstra 's algorithm shortest paths -


Dijkstra's algorithm shortest path problems.
6. Write pseudocode for 8 queen problern.

7. Write non-deterministic algorithm for sorting.


8. What is backtracking? Write general iterative algorithm
for backtracking.
9, DifferentiateNP complete withNP hard.

50lll1l20l6lt3260 (2\

www.aktuonline.com
F' ryT ,
www.aktuonline.com
'f
ST,E

I
l

NCS.sO1
Section-C
Note: Attempt any 2questions from this section.
(2x15:30)
10. i) State Bellman ford algorithm.

ii) Consider following instance for simple knapsack


problem. Find the solution using greedy method.
N:8
P : { I 1,21, 31, 33, 43, 53,55, 65}

W : {1, I l, 21,23,33, 43, 45, 55}


M: Il0
I l. What is travelling salesman problem? Find the solution
of following travelling salesman problem using branch
andboundmethod.

tr@@Etr
www.aktuonline.com

Cost matrix: FsltrEE,e


8trtrtrE
EEEgtrtr
EgNEtr
12. Prove that three coloring problem is NP Complete.

501,t11t2016n3260 (3)

www.aktuonline.com
www.aktuonline.com

Printed Pages: 4 NCS-501

(Follox'ing Faper ID and Roll No. to he filled in your


Answer Book)
Roll No.

B. Tech.

(SENI. V) THEORY trXAMII\ATION, 2015_1 6

DESTGN AND AJ\ALYSIS OF A LG ORITHIVI

[Tirne:3 lioursl Maxirnurn Marks:1001


www.aktuonline.com

Section-A
Note : Ali cluestions Are conrpulsory

1. Attcrnpt all parts . All parts carrv equal rnarks. Write


answer of all part in short . (2x1 0:20)

(a) Justifu'ohy Quick sort is better than Merge sort ?

(b) What is priority queue ?

(c) Find out l{arniltonian cycles in complete graph


having'n' vertices.

(d) fxpiain binornial heap with properties.

(e) Explain element searching techniques using divide


and conquer approach.

17500 (1) P.T.O.


www.aktuonline.com
www.aktuonline.com

(0 Find the subsets-of sum of following problem.


Given total elernents are (S)- {4,2,7,6,8} and
maximum SLIM is (X):8.

(g) Explain dynamic prosamming. How it is difflerent


from greedy approach ?

(h) Solve the given reculrence T'(n)- 4-l(*14)+n

(i) Ilifftrences back tracking and branch &" bound


programming approach.
www.aktuonline.com

(i ) Explain the P, NP and NiP- complete in decision


problems.

SECTIOI{-B

Note:Attempt any live questions frorn this section. ( l0x5-50)

2. Explain insertion in Red Black


'free. Shorv steps for
inserting 1,2,3, 4,5, 6 ,7 ,8 & 9 into ernpty RB tree.

3, l)iscuss knapsack problern rvith respect to rJ,vnamic


programming approach. Irind the optirnal solution for
given solution for given problern. w (r,veight set) :-
{5, 10, 15, 2A\ and W (Knapsack si ze): 8.

4. What is heap sort ? Apply heap sort algorithm for sorting


'r,2,3, 4, 5, 6,7, B, 9., 10. Also deduce time complexity
of heap sort.

175m (2) NCS.5O1


www.aktuonline.com
www.aktuonline.com

5. Explain B-Tree and insert eter,nents B, Q, L,,F i*to B-


Tree [Fig: I J then apply deletion af elements F, M., (i D.
B on resulting B-'free.

Fig. I
www.aktuonline.com

'Write
Q6. an algorithm for solving n-queen probleffi. Show
the solution of' 4 queen probleln using bracktrarcking
approach,

Q7. Explain a greedy single source shorlest path algoritlun


rvith example.

Q8" \,Vhat is string rnatching algorithm ? fxplain Rabin-Karp


methcld u,ith examples.

Q9. Explain Approximation algorithnrs rvith suitable


examples.

SECTION-C

Irlote:Attempt any two questions frcm this section. ( 15x2:30)

tr0. What is Fibonacci heap ? trxplain COi{SOLII);tif


operation with suitable example fto Fibonacci heap.

r75ffi (3) PT.O.


www.aktuonline.com
www.aktuonline.com

it. What is minimuril spanning iree ? fxplain Prirn


Algorithrn and find MST of graph [Fig:Z)

Fig: 2
www.aktuonline.com

12. ['rpiain TSP (trai,eiing sales person) problern u,ith


-['SP
exarnple. \\/rite an approach to sitlr,e prclblsm.

-"-x---

17500 (4) NCS.5O


www.aktuonline.com I
uptuonline.com uptuonline.com

Printed Pages-3 EC5502

lowing Paper ID and Roll No. to be filled in yourAnswer Book

B.Tech.
(SEM. V) ODD SEMESTER TTIEORY
EXAMINATION 2013.I4
DESIGN AND ANALYSIS OF ALGORITHMS

Time : 3 Hours Total Marks : 100


Note :- (l) All questions are compulsory.

(2) Each question carries equal marks.

1. Attempt any four parts of the following : (5x4=20)


(a) Consider the recurrences

T(n)=3T(il3)*cn,and
T (n) = 5 T (n/4) * n2 where c is constant and n is the
numberof inputs. Findthe asymptotic bounds.

(b) What do you mean by algorithm ? Write the characteristics


ofalgorithm.

(c) Sort the following array using heap-sort techniques :

{5, 13, 2,25,'7,17,20,8,4}. Discuss its worst case and


average case time complexities.

(d) Describe any one of the following sorting techniques :

(i) Selectionsort

(iD Insertionsort.

ECS502/pNG-52025 lTurnOver

uptuonline.com
http://www.UPTUonline.com
uptuonline.com uptuonline.com

(e) What do you understand by asymptotic notations ?


Describe important types of asymptotic notations.

(f) What is recursion tree ? Describe.

2. Attempt any two parts ofthe following : (10x2=20)

(a) Explain red-black tree. Show steps of inserting the keys


41, 38, 31,12,19, 8 into initiallyempty red-black tree.

(b) Write the characteristics of a B-Tree of order m. Create


B-Tree of order 5 from the following lists of data items :

20, 30,3 5, 85, I 0, 55, 60,25, 5, 65, 7 0, 7 5, 15, 40,50, 90, 45.

(c) What is a binomial heap ? Describe the union of binomial


heap.

3. Attempt any two parts of the following : (10x2=20)


(a) Describe and compare following algorithms to determine

the minimum cost spanningtree :

(i) Knrskal'salgorithm

(iD Prim'salgorithm.
(b) What is an optimization problem ? How greedy method
can be used to solve the optimization problem ?

(c) What is mahix chain multiplication problem ? Describe a


solution for matrix chain multiplication problem.

4. Aftempt any two parts of the following : (10x2=20)

(a) Write an algorithm to find shortest path between all pairs


of nodes in a given graph.

ECS502/pNG-52025

uptuonline.com
http://www.UPTUonline.com
uptuonline.com uptuonline.com

(b) Write short notes on the following :

(i) n-Queen problem

(iD Graph coloring.


(c) What is Ttavelling Salesman Problem (TSp) ? Discuss at

least one approach used to solve the problem.

5. Attempt any two parts ofthe following: (10x2=20)


(a) Discuss the problem classes P, NP and NP-complete.
(b) What is FFT (Fast Fourier Transformation) ? How the
recursive FFT procedure works ? Explain.

(c) Write short notes on Randomized algorithms.

ECS502/pNG-52025 16575

uptuonline.com
http://www.UPTUonline.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy