0% found this document useful (0 votes)
8 views4 pages

btech-cse-4-sem-design-and-analysis-of-algorithms-105402-2022

The document is an exam paper for B.Tech 4th Semester in Design and Analysis of Algorithms, containing various questions related to data structures and algorithms. It includes multiple-choice questions, short answer questions, and problems requiring detailed explanations and calculations. The exam covers topics such as sorting algorithms, time complexity, dynamic programming, and graph theory.

Uploaded by

roshnising8892
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)
8 views4 pages

btech-cse-4-sem-design-and-analysis-of-algorithms-105402-2022

The document is an exam paper for B.Tech 4th Semester in Design and Analysis of Algorithms, containing various questions related to data structures and algorithms. It includes multiple-choice questions, short answer questions, and problems requiring detailed explanations and calculations. The exam covers topics such as sorting algorithms, time complexity, dynamic programming, and graph theory.

Uploaded by

roshnising8892
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/ 4

Code : 105402 I 2 )

lb/ Whic h o ne o f the following is an


B.Tech 4th Semester Ezam., 2022 11pplacauon o f Queue Data S tructure?
( 1} V."hen a resou~ is shared among
( New Course ) multiple conaum~

/ 11) When data ia transferred async hro-


DESIGN AND ANALYSIS OF ALGORITHMS nously (data not n ec-essarily
~~1 ved at lll&Ine rate- a s sent)
Time : 3 hours FUU Marks : 70 ~tw~n ~'O p roccsS«"s

{W) Load bal&nci0«


Instructions :
{Ill) All o( the a~
(i) The marks are indicated in the right-hand mo.rgirL
( C) The complexity of b inary search
(ii) There are NDIB questions in this paper. aleorithm IS
(iii) Attempt nVB questions in all. {i} O(")
(iu) Question No. i is compulsory.., (U) O(logn)

(In) O(n 2 )
1. Choose the correct answer of the following
(iv} O(n liognl
(any seuenJ : 2><7-14

(a) Any decision trees that sorts n (d) In linear eearch aJgonthm the worst
elements has height ca.e occurs when

(i) O(lgn)
fiJ the item is aomewhere in the
middle of the array
(ii) O(n) flJJ the item ia not in the array at all
.. ·
(iii) O(nlgn) fiiiJ the item i.a the laat element in the
aJTaY
(iv) O(n2 ) flvJ the item i.a the laat elenw:nt in the
arTllY or i.s not there at all

AK23/336 (~ . ~)
f Continued I
https ://www.a k ubihar.com h ttps ://www.akubihar. c om
( 3 , ( 4 )

(e) Given an un.art.ed arT-.y. The aJTa,y haa (g) Jn the divide and conquer process,
thi• property that every element in breaking the p roble m int o s m aller s u b-
array ie at moat le diet.a.nee from it• proble m s is the r esponsibility of
position in sorted array where k i• a {i) divide/break
positiv e integer smaller than •iz.e or
array . Which sorting algo rithm can be (ii) sorting/ divid e
easily modified for sorting thi• array (iii) conquer/ solve
and what 1s the obtainable time
(iv} m erge/combine
complexity?
{h) A p riority que u e is implemented as a
( i) Insertion eort with time complexity Max- h eap . Initially it has 5 e le m ent s .
O(kn) T h e level order trave r sal of the heap is
10, 8 , 5, 3, 2 . Two new e lem ents 'l' and
(ii} Heap llOrt with time complexity 7' are inserted into the h eap in that
O (n logic) order . T he level o r d e r traversal of the
h ea p after the insertion of the elem ents
(iii) Quick eort with time complexity is
O(klo gk)
(i} 10, 8, 7, 5, 3, 2 , 1
(i v) Merge eort with time compleaity (ii} 10, 8, 7 , 2, 3, l, 5
O(kloglc)
{iii) 10, 8, 7, 1, 2, 3, 5
(iu) 10, 8, 7, 3, 2, 1, 5
(/} Approac h or dynamic pt oCi emmina ia (i) If a p roblem can be solved by
similar to com bin ing optim al sol utions to n o n -
oved apping problems, the strategy is
(iJ paning c alled
tuJ haah table {i) dynamic p rogramming
(ii) greedy
(iii} divide and conquer aJww ii' '
(iii) divide and con quer
(iv} greedy a.IFrithm (iv) recursion

AK23/336 , ~ 0...-1 AK23 /336 ( Continued J


h ttps://www.a kub ihar.com https://www.akubi ha r.com
( 5 ) ( 6 ,

(j) The choice of polynomial class has led 3. (a) Explain the working of merge sort
to the development of an extensive algorithm with an example. Give the
theory called complexity calculation of merge sort. 7
(i) computational complexity
(b) What are the rules of manipulate
(ii) time complexity B ig-Oh expression and about the
(iii) problem comple,Oty typical growth rates of algorithms. 7
(iv) decision complexity
4. (a) What is heap sort? What is the effect of
2. (a) Calculate the time complexity of the calling MAX-HEAPIFY(A, i) when the
following problem using divide and element A[i) is larger than its children? 7
conquer strategies : 7
(b} Explain how radix sort works, to what
(i) T(n) = ../nT(= ..In)+ n, n > 2 inputs it can be applied and what is its
asymptotic complexity? 7
=a, n s 2
{ii) T(n) = T(n -1) + 1 / n, n > 1 5. What do you mean by optimal solution in
=1,n=l ' greedy approach? Define the properties and
function of greedy approach. Consider the
(b) Write time function and calculate the graph G = (V, E) given below. Find the
time complexity, space complexity and minimum spanning tree by Prirn's
number of function calls of the following algorithms. 14
pseudocode using substitution method : 7
rec (n) {
if (n s 1)
return(!);
else {
rec (n/2);
for (i = l; i s n; i + +)
prin tI(•algorithm.};
}

AK23/336 ( Tum Over J AK23/336 (Continued}

https://www.akubihar.com https://www.akubihar.com
( 7 )

6. Find the optimal way to multiply the


following matrices to perform the fewest
multiplications : 14

Matrix Al A2 A3 A4
Dimensio n S x 11 11x4 4 xl5 15 x23

7. You are given a graph containing n vertices


a nd m edges and given that the graph
doesn't contain cycle of odd length. What is
the time complexity of the best known
algorithm to find out whether the graph is
bipartite or not? 14

8. What is activity sele c tion problem? Suppose


that instead of always selecting the first
activity to fini s h, we select the last activity to
start that is compatible with all previo usly
selected activities. Describe how this
approach is a greedy algorithm, and
prove that it yields an optimal solution. 14

9. Write short notes on the following : 14


(a) Cook's theorem
(b) Approximation algorithms

* **

AK.23-441O /336 Code 105402

https ://www.akubihar.com

You might also like