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

2011 Daa End-Regular

This document contains instructions for a Design and Analysis of Algorithms examination at KIIT University in Bhubaneswar, India. Students must answer 6 questions including question 1, which is compulsory. Question 1 contains 10 subquestions (a)-(j) worth 2 marks each. The remaining questions 2-8 are worth 4 marks each. Students must write their answers in their own words and all parts of each question should be answered together.
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)
60 views4 pages

2011 Daa End-Regular

This document contains instructions for a Design and Analysis of Algorithms examination at KIIT University in Bhubaneswar, India. Students must answer 6 questions including question 1, which is compulsory. Question 1 contains 10 subquestions (a)-(j) worth 2 marks each. The remaining questions 2-8 are worth 4 marks each. Students must write their answers in their own words and all parts of each question should be answered together.
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

KIIT UNIVERSITY, BHUBANESWAR

FIFTH SEMESTER EXAMINATION-2011

Applicable for branches----CS/IT---------------------------------------------------------

Name of the Paper-----------Design and Analysis of Algorithms--------------------

Paper code--------------------CS-602------------------------------------------------------

Full Marks---------------------60-----------------------------------------------------------
Answer any SIX questions including Question No.1 which is compulsory.
The figures in the margin indicate full marks.
Candidates are required to give their answers in their own words as far as practicable and
all parts of a question should be answered at one place only .

Instruction regarding answering questions


Q. No Marks
1. [2×10]
(a) f(n)=Ө(g(n)) implies
A. 0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) v n ≥ n0 , where c1, c2, and
n0 are positive integers
B. 0≤ c1 g(n)≤ f(n) ≤ c2 g(n) v n ≥ n0 , for some positive
constants c1, c2, and n0
C. 0≤ c1 g(n)≤ f(n) ≤ c2g(n) v n ≥ n0 , for any positive
constants c1, c2, and n0
D. None of these

(b) Find the Theta (Ө) notation for the following function
f(n) = log(n!)

(c) What is the content of the given array (15, 27, 8, 37, 10,
50, 54, 31, 85, 5) after 4 iterations of Insertion-sort?

(d) An input comprises a sorted list of n integers with many


duplications such that the number of distinct integers in
the sequence is O (log n), what is the time complexity to
find an element in the list?

(e) What is the time complexity of inserting „log2n‟ number of


elements into a binary heap of size n?
(f) Given 11 activities, A=<A1, A2,….,A11> along with their
start time (si) and finish time (f i) as Si=<1, 2, 3, 5, 7, 8, 9,
10, 12, 12, 14> and fi=<3, 5, 4, 7, 10, 9, 11, 11, 12, 14,
15>. Compute a schedule where largest number of
activities takes place.

(g) Which of the following is the correct ordering for optimal


storage on tape problem, If there are 5 programs of length
l1=7, l2=10, l3= 5, l4=3, and l5= 4 and a tape T?
A. l4, l2, l3, l5, l1 B. l4, l5, l3, l1, l2 C. l4, l5, l1, l3, l2
D. l2, l4, l3, l5, l1
(h) An adjacency-matrix representation may be preferred in
implementing
A. Kruskal‟s Algorithm B. Prim‟s Algorithm
C. Dijkstra‟s Algorithm. D. Floyd-Warshall‟s Algorithm
(i) Differentiate between Divide-And-Conquer and Dynamic
Programming approach.
(j) Define NP-Completeness and give two examples of NP-
complete problems.
[2×4]
2.
(a) Write the recurrence and solve it for the following code
segment.
Int BTECH(int n)
{
if (n== 1)
return(1);
else
return(BTECH(n-1) + BTECH(n-1));
}
(b) State and explain Master‟s theorem. Solve the following
recurrence using master‟s method.
T(n)=9T(n/3) + n
3. [2×4]
(a) Consider a set S of n ≥ 2 distinct numbers given in
unsorted order and, x and y are two distinct numbers in the
set S. Write an O(n) time recursive algorithm to determine
x, y ∈ S such that |x-y| ≥ |w-z| for all w, z ∈ S. Also write
the recurrence of the above procedure and show that its
complexity is O(n).

(b) Write a Quick-Sort algorithm in which the PARTITION


procedure always produces a n/4 and 3n/4 proportional
split of the array. Write the recurrence of the above Quick-
Sort algorithm and find its time complexity.
4. [2×4]
(a) Find an optimal parenthesization of a matrix-chain product
whose sequence of dimensions are
<5, 7, 10, 4, and 6>.

(b) A robot arm is employed to tighten the nuts on some piece


of machinery on an assembly line. The arm will start from
its initial position i.e. the first nut to be tightened,
successively move to each of the remaining nuts, and
return to the initial position. The arm movement time from
one nut i to other j is a variable, denoted by c ij and can be
expressed in the matrix form given below. Find a
minimum-cost tour of the robot arm that will minimize the
time needed to complete its tasks.

5. [2×4]
(a)
Write HUFFMAN‟S algorithm and obtain a set of optimal
Huffman codes for the messages (M1 ….M5) with relative
frequencies f1: 12, f2: 20, f3: 10, f4: 35, f5: 23. Draw the
decode tree for this set of codes.
(b)
Apply prim‟s algorithm to find minimum cost spanning
tree of the following graph by taking „a‟ as the root vertex.
10 a
f 28
25 g
14 b
e 24 16
6
c
22 d 12
[2×4]
6.
(a) Write an algorithm for Building a min-heap and find its
worst-case time complexity. Build a min heap considering
the following array elements and also show the heap data
structure at each step. A[ ] = {10, 7, 14, 6, 5, 12, 7, 4, 9,
1}.

(b) Find out the time complexity of a “BINARY SEARCH”


algorithm that always splits an array into two sets, one of
which is twice the size of the other. Also write the
algorithm for above procedure. How does this algorithm
compare with standard BINARY SEARCH?
[2×4]
7.
(a) Write a procedure for union operation between two sets
using a disjoint-set forest.

(b) Apply backtracking to solve the following instance of the


sum of subset problem. S= {2, 3, 4, 5} and m=11. Also
write the algorithm for sum of subset problem. [2×4]

8.
(a) Write the algorithm for All-Pairs Shortest path and find
out its time complexity.

(b) Prove that if any NP-compete problem is polynomial time


solvable, then P=NP. Equivalently, if any problem in NP
is not polynomial time solvable, then no NP-complete
problem is polynomial time solvable.

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