0% found this document useful (0 votes)
26 views9 pages

set-d-daa-ct1-qp-solns

This document outlines the details of a test for the course 'Design and Analysis of Algorithms' at SRM Institute of Science and Technology for the academic year 2023-24. It includes the course outcomes, a matrix linking them to program outcomes, and a series of questions divided into parts A, B, and C, covering various algorithm concepts and complexities. The test is scheduled for February 19, 2024, with a maximum score of 50 marks.

Uploaded by

Shantanu V
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)
26 views9 pages

set-d-daa-ct1-qp-solns

This document outlines the details of a test for the course 'Design and Analysis of Algorithms' at SRM Institute of Science and Technology for the academic year 2023-24. It includes the course outcomes, a matrix linking them to program outcomes, and a series of questions divided into parts A, B, and C, covering various algorithm concepts and complexities. The test is scheduled for February 19, 2024, with a maximum score of 50 marks.

Uploaded by

Shantanu V
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/ 9

lOMoARcPSD|29290856

SRM Institute of Science and Technology


College of Engineering and Technology
School of Computing
SRM Nagar, Kattankulathur – 603203, Chengalpattu District, Tamil Nadu
Academic Year: 2023-24 (EVEN)

Test: CLA-T1 Date: 19.02.2024


Course Code & Title: 21CSC204J Design and Analysis of Algorithms Duration: 1 hour 40 min
Year & Sem: II Year / IV Sem Max. Marks: 50

Course Articulation Matrix:


Course Outcome PO PO PO PO PO PO PO PO PO PO PO PO Program Specific
1 2 3 4 5 6 7 8 9 10 11 12 Outcomes
PSO- PSO- PSO-
1 2 3
CO1 2 1 2 1 - - - - 3 - 3 3 1 -
CO2 2 1 2 1 - - - - 3 - 3 3 1 -
CO3 2 1 2 1 - - - - 3 - 3 3 1 -
2 1 2 1 - - - - 3 - 3 3 1 -
CO4

CO5 2 1 2 1 - - - - 3 - 3 3 1 -

Part - A
(1 x 10 = 10 Marks) Instructions: Answer all
Q. Question M B C P P
No a L O O I
r C
k o
s d
e
1 Correctness of algorithm means 1 1 1 1 1.
a) Algorithm works in linear time 6.
b) Algorithm uses linear space 1
c) Algorithm is efficient
d) Algorithm behaves as expected
2 The objective of time complexity analysis is 1 1 1 1 1.
a) To determine the development time of algorithm 6.
b) To determine the compile time of algorithm 1
c) To determine the running time of algorithm
d) To determine the complexity of conditions in an algorithm

3 Asymptotic notations deal with 1 1 1 12 1.


a) Running time for small values of input 6.
b) Running time for medium values of input 1
c) Running time for large values of input (tending to ∞ )
d) Running time for inputs in the range 1-100
4 Which among these is both an asymptotically tight lower and upper bound 1 1 2 3 1.
? 7.
a) O(n) b) o(n) c) ω (n) d) Θ(𝑛) 1

Answer: d) Θ(𝑛)

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

5 𝑓(𝑛) = 𝑛 is
2 1 1 2 3 1.
2.
a) ( 2) b) 𝑂(log 𝑙𝑜𝑔
𝑂 𝑛 𝑛) c) 𝑂(𝑛) d) 𝑂(1)
2
1
Answer: a) 𝑂(𝑛 )

6 The worst case running time of binary search is 1 1 2 3 1.


a) ( ) c) 𝑂(log 𝑛) d) 𝑂(1)
𝑂(𝑛) b) 𝑂 𝑛
2 7.
1
Answer: c) 𝑂(𝑙𝑜𝑔 𝑛)

7 Which among the following is NOT an application of divide and conquer 1 1 2 3 1.


strategy? 7.
a) Bubble sort 1
b) Binary Search
c) Merge sort
d) Strassen’s matrix multiplication
8 Partition algorithm on an array of size n takes running time 1 1 2 3 1.
a) ( ) c) 𝑂(log 𝑙𝑜𝑔
𝑂(𝑛) b) 𝑂 𝑛
2
𝑛) d) 𝑂(1) 7.
1
Answer: a) 𝑂(𝑛)

9 In order to divide the closest pair problem into subproblems, we need to 1 1 2 3 1.


compute 7.
a) Median x-coordinate 1
b) Min x-coordinate
c) Mean x-coordinate
d) Mode of x-coordinates

10 Which technique can be used to obtain the asymptotic running time for a 1 1 2 3 1.
recursive algorithm by direct application without solving recurrences? 7.
a) Master theorem 1
b) Substitution method
c) Recursion tree
d) Mathematical Induction

Part – B
(5 x 4 = 20 Marks) Instructions: Answer All the Questions
11 2
Prove that 3𝑛 + 2𝑛 + 5 ∈ Θ 𝑛
2
( ) 5 2 1 1 1.
2.
1

12 Solve 𝑇(𝑛) = 2 𝑇 ( ) 𝑛
2
+ 𝑛 using recursion tree method (Assume T(1) 5 2 1 1 1.
2.
= 1).
1

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

13 Illustrate Partition algorithm used in quicksort for the following array: 31, 5 2 2 3 2.
43, 22, 15, 54, 17, 44, 29, 38 (use first element as pivot) 6.
2

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

14 State Master theorem and demonstrate with an example. 5 2 2 1 1.


2.
1

Part – C
(2 x 10 = 20 Marks) Instructions: Answer All the Questions
15. Consider the algorithm below: 1 3 1 2 2.
A Algorithm F(A, lo, hi) 0 6.
Begin 2
If hi = lo return A[lo]
Mid = floor( (hi + lo)/2)
X1 = F(A, 1, mid)
X2 = F(A, mid+1, hi)
Return(X1 + X2)
End
(i) Summarize what algorithm F is doing?
(ii) Devise recurrence relations for running time of algorithm F (Assume
inputs which are powers of 2).
(iii) Compute the asymptotic time complexity using substitution method.

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

OR
15. Vimal works with a detective agency and is need of processing suspect 1 3 1 2 2.
B details in alphabetical order quickly. He has two processes running 0 6.
simultaneously (a) a sorting algorithm that will sort details of suspects and 4
provide them in sorted order (b) a background process that will process
the next suspect in sorted order without waiting for entire sorted list. He is
in need of completing the task non-recursively and quickly.
(i) Recommend the appropriate sorting algorithm for this task.
(ii) Compute the time complexity of this algorithm.
(iii) List the best case, average case, worst case time complexity of this
algorithm.

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

Partial Marks for insertion sort may be given.


16. Ashiq provides an online sorting service for his customers. He is afraid 1 3 2 2 2.
A that some malicious users will send sorting sequences that will take a long 0 6.
time to sort. 4
(i) Analyze which sorting algorithm should he use for best sorting
performance? Justify your answer.
(ii) Explain the algorithm for the same.
(iii) Illustrate how the algorithm will work for the following array 37,
12, 8, 35, 27, 39, 18, 25.

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

Partial Marks for quicksort may be given

OR
16. Victory Supermarket has introduced an innovative incentive mechanism 1 3 2 2 2.
B for its sales representatives. Each sales representative has to make Rs X 0 5.
sales in a day. If he or she makes Y sales, then she gets Y – X points for 3
that day. The incentive for the month is determined by the largest
continuous cumulative streak of points (LCCSP) bagged by the sales
representative over the month obtained by summing up a sequence of
consecutive values.
(i) Devise an algorithm to compute the LCCSP for each sales
representative in a month.
(ii) Illustrate how the LCCSP will be computed for the following
sequence: 13, 8, 14, 12, 17, 21, 13, 16, 5 the sales representative is
required to make Rs.15/- each day.

Downloaded by Shantanu V ([email protected])


lOMoARcPSD|29290856

Downloaded by Shantanu V ([email protected])

You might also like