0% found this document useful (0 votes)
57 views7 pages

Ada QP

The document is a question paper for an examination on analysis and design of algorithms. It contains 9 questions with multiple sub-questions. The questions cover topics like asymptotic analysis, sorting, searching, graph algorithms, dynamic programming, NP-complete problems, and more. Students are required to write algorithms, analyze time complexities, solve problems like knapsack, travelling salesman, graph coloring, and more. They need to apply concepts like recursion, backtracking, greedy approach, and algorithm design techniques.
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)
57 views7 pages

Ada QP

The document is a question paper for an examination on analysis and design of algorithms. It contains 9 questions with multiple sub-questions. The questions cover topics like asymptotic analysis, sorting, searching, graph algorithms, dynamic programming, NP-complete problems, and more. Students are required to write algorithms, analyze time complexities, solve problems like knapsack, travelling salesman, graph coloring, and more. They need to apply concepts like recursion, backtracking, greedy approach, and algorithm design techniques.
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/ 7

USN 2 BA2 s06 UIS403C

B.E. Fourth Semester End Examinations, August 2022

Duration: 3 Hours
Analysis and Design of Algorithms
Max. Marks: 100
NOTE:PART-A: All questions are compulsory
PART-B: Answer any one question from each unit.
Q. No. Question Marks BLL CO PI

PART-A

1. i. Find binomial coefficient of C (5, 3). (02) L2 2 1.4.1


ii. Which of the following is used for solving the N Queens (01) L1 2 1.3.1
Problem?
a. Greedy algorithm b. Dynamic programming
c. Backtracking d. Sorting
iii. What is AVL Trees? (02) LI 2 1.3.1
iv. To main measures of the efficiency of an algorithm are? (01) L1 2 1.3.1
a. Time and space complexity b. Data and space
c. Processor and memory
V. Identify the sorting technique which compares adjacent elements (01) L1 2 1.3.1
in a list and switches whenever necessary?
a. Merge Sort b. Quick Sort
C. Bubble Sort d. Selection Sort
vi. The worst-case time complexity of Quick sort is? (01) L1 2 1.4.1
a. O(n) b. O(1)
C. O(log2n) d. O(n^2)
vii. Which of the following algorithms are used to find the shortest (01) L1 2 1.3.1
path from a source node to all other nodes in a weighted graph?
a. BFS b. Dijkstra's Algorithm
c. Prim's Algorithm d. Kruskal's Algorithm
(02) L1 2 1.3.1
vii What is algorithm?
1X Define heap. (02) LI 2 1.3.1
(02) LI 2 1.3.1
X. What is complete binary tree? LI 2 1.4.1
Xi. Kruskal's Algorithm for finding the Minimum Spanning Tree of (01)
a graph is a kind of a?
a. DP Problem b. Greedy Algorithm
C. Adhoc Problem d. None of the above
L2 2 1.4.1
xii. Find GCD of (15, 70). (02)
L2 2 1.4.1
xiii Dijkstra's algorithm is used to solve ----- problems? (02)
a. Network lock b. Single source shortest path
C. Sorting d. All pair shortest path

1
UIS403C
Q. No. Question Marks BLL CO PI
PART-B

UNIT
2. a) With a neat diagram explain the algorithm design and
process. analysis (10) L2 1 13.1
b) Describe travelling salesman and
c) There are 28 gloves in a drawer: graph-coloring problems.
6 pairs of red gloves, 5 pairs of
(05) L2 1 1.3.1
yellow and 3 pairs of green. You select the gloves in the dark (05) L3 5 2.2.3
can check them only after a selection and
has been made. What is the
smallest number of gloves you need to select to have at
matching pair in the best case? In the worst case? least one
3 a)
Explain different types of asymptotic notations.
b) Consider the following algorithm: (06) L2 1 1.3.1
ALGORITHM T(n) (06) L3 14,5 2.2.3
lInput : Anon-negative integer n
S-0
forrie-l
i to n do
S-S+1
return S
i. What does this algorithm compute?
What is its basic operation?
How many times is the basic operation
iv What is the efficiency class of this executed?
gWrite algorithm to compute the n" Fibonaccialgorithm?
number recursively
and explain mathematical analysis of the (08) L2 1.4,5 1.4.1
same.
UNIT-II
4. a) Write an algorithm for bubble sort
B. A, G, A, L, K, 0, T in method. Sort the list: (09) L3 2,4,5 2.23
alphabetical order by bubble sort
algorithm. Derive an expression for time efficiency
b) Write brute force string of the same.
matching algorithm. Find
character comparisons that will be made by same the number of (06) L3 2 2.2.3
pattern ABABC in the following text: algorithm for the
c) Define master theorem. Compute the timeBAABABABCCA.
following recurrence equations using the same:
complexity for the (05) L3 4 14.1
1
T(n-4T(n2)+n, T(l=1
ii.
T(n)-4T(n/2)+n', T(1)=1
5. a) Write quick sort algorithm. Apply the
same
array in ascending order: 5, 3, 1,9, 8, 2, 4, 7. to sort the following (10) L3 1.2 2.2.3
b) Explain binary tree traversal with example.
c Apply the DFS-based algorithm to solve the (05) L3 2 1.4.1
topological sorting
problem for the following graph, starting at vertex (05) L3 2
2.2.3
a.
UIS403C

Q. No. Question Marks BLL CO PI

UNIT-|
6. a) Construct a 2-3 tree for the list C, 0,
b) What is problemn reduction strategy?M,P,U,
T, I, N, G. (05) L3 2 2.2.3
Explain any three examples
of algorithms based on the strategy of problem (10) L2 2 2.2.3
c) Write an algorithm for comparison counting reduction.
sort method. (05) L2 2.23
Apply Boyer-Moore algorithm to search for the pattern BAOBAB (10) L3 2 2.2.3
in the text BESS KNEW
ABOUT BAOBABS.
What is dynamic programming? Using
solve the following knapsack instance: dynamic programming. (10) L3 2 2.2.3
n-3, [Wi. W2, Wi] = [1, 2, 2], [Pi., P2, Ps] = [18, 16, 6] and W-4.
UNIT-IV
a) Write and apply Kruskal's algorithm for the
following graph: (10) L3 2 2.2.3

b) Write and apply Huffman's algorithm to construct Huffman tree


(10) L3 2 2.2.3
for the following data:
Character A B CD -

Probability 0.35 0.10.2 0.2 0.15


Using the code generated:
1 Encode ADA
i. Decode 0011100

9. a) Explain P, NP and NP-complete problems in detail with examples. (10) L2 6 1.4.1


b) What is n-queens problem? Solve 4-queens problem by applying (10) L3 6 2.2.3
backtracking.

3
B. V.V. Sangha's
BASAVESHWAR ENGINEERING COLLEGE (AUTONOMOUS), BAGALKOT
DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING
ACADEMIC YEAR 2021-2022 (Even Semester)
I CIE TEST question paper
Course: B.E (ISE)
Semester: IV sem
Subject: Analysis and Design of Algorithms
Division: A & B
Subject Code: UIS403C
Time: 9:00am-10:30am
Date: 16.6.2022
Max. Marks: 40
Faculty: Ms. G M. Patil

Note: 1. Part- A: All questions are


compulsory
2. Part- B: Answer any one full
question from each unit.
PART - A

Q. No Questions Marks BLL CO PI


1 i. Find possible subsets fora set of elements S={1,2,4). 2 1 2 1.1.1
ii. How many comparisons made by Bubble sort
the worst case input?
algorithm for 2 3 2 1.4.1

iii. How one can identify the graph is cyclic? 2 2 1.4.1


iv. Generate all permutations of (1,2,3} by Johnson Trotter 2 2 1.4.1
algorithm.
v. What is largest number of key
comparisons made by 2 3 2 1.4.1
binary search algorithm in searching for a key in following
input?
4,10,15,20
PART -B

Q. No Questions Marks BLL CO PI


UNIT -I
a) Explain design and analysis process with flow chart. 10 1.4.1
b) Mystery(n)
Ili/p: non negative integer n
S-0

for i-1 ton do


S=S+i*i*i
5 3 2 2.2.3
return S

What does this algorithm compute?


ii. What is its basic operation?
i. How many times is the basic operation
executed?
iv. What is the efficiency class of this algorithm?

3 a) Design algorithm to find GCD of two numbers that


3.2.1
uses subtractions rather than integer divisions. 7 4 3

b) Explain different types of data structures


with8 2 2.2.2
example.
UNIT -II
a) Write Brute Force algorithm to count number of
3.2.1
vowels in a given text. 7 3 3

b) Apply Bubble sort algorithm to sort list


and calculate time complexity of algorithm.M,E,R,G,E8 4 4 2.2.4

5 a) Apply Quick sort algorithm to sort the input 5,4,3,2,1. (05) 3 2 2.2.3
b) Summarize how one can identify
connected
components of a graph by using
10 3 2 2.2.4
Breadth-first search
ii. Depth-first search
1

B. V. V. Sangha's
BAGALKOT
BASAVESHWAR ENGINEERING COLLEGE (AUTONOMOUS),
ENGINEERING
DEPARTMENT OF INFORMATION SCIENCE AND
ACADEMIC YEAR 2021-2022 (Even Semester)
I|CIE TEST question paper
Semester: IV sem
Course: B.E (ISE)
Subject: Analysis and Design of Algorithms Division: A & B

Subject Code: UIS403C Time: 9:00am - 10:30am


Date: 08.08.202 2 Max. Marks: 40

Faculty: Ms. G M. Patil


Note: 1. Part- A: All questions are compulsory
2.. Part B: Answer any one full question from each unit.
PART - A
Q. No Questions Marks BLL CO PI
1 i. Find Binomial coefficientC(3, 2). (02) 2 2 1.1.1
ii. Define heap. (02) 1 2 1.4.1

ii. Find GCD (15,20) using probiem reduction method. (02) 2 2 1.1.1
iv. What are different approaches used to resolve collision in
(02) 1 2 1.4.1
hashing?
V. What is P problem? (02) 1 2 1.4.1

PART -B
Q. No Questions Marks BLL CO PI
UNIT - III

2 a) Apply Floyd's algorithm for the graph given below:

(10) 3 2 2.2.3
4
2

b) Construct AVL tree for list 3/3,81,10,4. (05) 3 2 2.2.3


3 a) Explain Hashing with example. (07) 2 2
b) Find the pattern 'ART in text 1SE_DEPARTMENT using (08) 3 2 2.2.3
nstruct shit 1abe Horspool string matching algorithm. Construct shift table.
UNIT-V
4 a) i. Construct a Huffman tree for the following data and obtain
its Huffman code. (10) 2 2 2.2.3

eharacter

i. Encode Ehe text DAD_BE using the code of question ().


ii. Decode the text whose encoding is 1100110110 in the
code of questian (i).
b) Differentiate Branch and Bound and Backtracking. (05) 4 2 2.2.4
5 a) Explain Backtracking with n-Queens Problem.
(08) 3 6 2.2.3
b) Apply Kruskal algorithm to find a minimum spanning tree of
(07) 3 2 2.2.3
the following graph.

You might also like