0% found this document useful (0 votes)
16 views2 pages

BCSE204L CAT1 Model Question

The document outlines a Continuous Assessment Test for a B.Tech. course in Design and Analysis of Algorithms, detailing the structure, instructions, and rubrics for five questions. Each question requires a design and analysis component, including pseudocode, proof-of-correctness, and time-complexity analysis. The test emphasizes the application of algorithmic strategies such as Divide-Conquer-Combine and includes tasks related to sorting words, generating integers, and matrix computations.

Uploaded by

Arnav Kamra
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)
16 views2 pages

BCSE204L CAT1 Model Question

The document outlines a Continuous Assessment Test for a B.Tech. course in Design and Analysis of Algorithms, detailing the structure, instructions, and rubrics for five questions. Each question requires a design and analysis component, including pseudocode, proof-of-correctness, and time-complexity analysis. The test emphasizes the application of algorithmic strategies such as Divide-Conquer-Combine and includes tasks related to sorting words, generating integers, and matrix computations.

Uploaded by

Arnav Kamra
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/ 2

Continuous Assessment Test I - Model question

Programme B.Tech.(CSE) Semester XX


Course Design and Analysis of Algorithms Code BCSE 204L
Faculty YYY Slot/Class No. Z/CH1234567

Time 90 Minutes Max. Marks 50

Instructions:

ˆ Answer all the FIVE questions.


ˆ If any assumptions are required, assume the same and mention those assumptions in the answer script.
ˆ Use of intelligence is highly appreciated.
ˆ Your answer for all the questions should have both the ’design’ component and the ’analysis component’
ˆ The ’Design’ component should consist: understanding of the problem, logic to develop the pseudocode,
illustration, pseudocode.
ˆ The ’Analysis’ component should consist: Proof-of-correctness, Computation of T(n), Time-complexity.
ˆ For question numbers. 1 & 2, rubric is : Logic (2 marks), Illustration(2 marks), Pseudocode(2 marks),
Proof-of-correctness(2 marks), running-time and the time-complexity (2 marks).
ˆ For question no. 3, rubric is : logic of the three pseudocodes (3), illustrations for the three pseudocodes
(2), three pseudocodes (2) time-complexities of the three pseudocodes (2) and the conclusion on the
efficient pseudocode (1).
ˆ For question No.5, rubric is : Proposal of the problem (1 marks), logic of the pseudocode A(1 mark), Illus-
tration for A(1 mark), pseudocode A(1 mark ), logic for the recursive pseudocode B (2 mark),pseudocode
B(1 marks ), Illustration for B(1 marks), Time-complexities of A and B and the conclusion (2 marks),

1. The symbols a, e, i, o, u are called as vowels and the remaining symbols of English alphabet are called
consonants. A word of length 6 (a word with 6 symbols) w1 is said to be vowel − greater than another
word w1 of lenght 6 if the number of distinct vowels is greater than or equal to the number of distinct
vowels in w2 . If two words w1 , w2 have the same number of vowels, the word which comes later in an
alphabetical order, is said to be vowel −greater than the other. The number of distinct vowels in abbaae
is 2. The word aaeoub is said to be vowel − greater than the word abedf g since the number of distinct
vowels in the first word is 4 and the number of distinct vowels in the second word is 2. Similarly, the
word deoudd is vowel − greater than cedodu. Here, both the words have the same number of vowels
and the first word deoudd comes later in the alphabetical order when compared with the second word
cedodu. Given the three words dedodu, aeiouu, bef ghs, they are arranged in an ascending order with
respect to the operator vowel − greater, as bef ghs, dedodu, aeiouu. Consider an array of n distinct
words of same length (ie., no two words are same), design a pseudocode to sort the array in an ascending
order with respect to the relational operator vowel − greater. Your design component should contain
all the required components. Analyse the pseudocode with all the required steps. [10]

2. Given an n-digit positive integer m (with digits from 0 to 9 ) design a pseudocode with the ‘Divide-
Conquer-Combine’ strategy to generate all n-digit possible integers m′ derived from m such that all
digits of m are present in m′ and the the first digit of m′ is same as the last digit of m′ . The pseudocode
should return all the possible words m′ in an ascending order. For example, if m=12323, your pseudocode
should return 21332, 23132, 23312, 31223, 32123, 32213. If m = 1234, it is clear that no m′ is possible
since there are no duplicate digits . Your design component should contain all the required steps.
Analyse the algorithm with all the required steps. [10]
3. Given a matrix A  
a11 a12 ... a1n
 a21 a22 ... a2n 
 
 . . . . 
 
 . . . . 
an1 an2 ... ann
where a′ij s are the integers in the position (i, j). Design three different pseudocodes using the ‘Divide-
Conquer-Combine’ strategy, in three different ways to compute M , where

M = M ax{aij , 1 ≤ i ≤ n, 1 ≤ j ≤ n}.

Based on the time-complexities of the three pseudocodes, identify the efficient pseudocode. Besides the
three different pseudocodes, your answer should contain the logic of the three pseudocodes, illustrations
for the three pseudocodes, time-complexities of the three pseudocodes and your conclusion on the efficient
pseudocode. [10]
.

4. Consider the following algorithm.

ˆ Algorithm YYY(n)
ˆ 1. Read n
ˆ 2. Initialise sum to 0
ˆ 3. Initialise digit to 1
ˆ 4. Repeat
ˆ 5. digit= Mod(n,10)
ˆ 6. n=n/10
ˆ 7. sum=sum*10+digit
ˆ 8. Until n==0
ˆ 9. Write sum
ˆ 10. Stop.

Understand the functionality of the above algorithm and answer the following.

(a) Write the output of the algorithm when (i) n = 231, (ii) n= 5 [2]
(b) Describe the functionality of the above algorithm. [3]
(c) Compute the time-complexity of the algorithm. [2]
(d) Modify the above algorithm in such a way that the time-complexity of the modified algorithm
remains the same. [3]

5. Propose a problem in detail (of your choice), which is not discussed in your class-room as well as in
the lab sessions. Write a brute-force pseudocode A to solve the problem proposed by you. Compute
the time-complexity of the pseudocode A. Transform your pseudocode A into an equivalent pseudocode
B which uses divide-conquer-combine strategy. Compute the time-complexity of both the pseudocodes
A and B and identify the efficient one. Note that you are required to propose a problem for which a
divide-conquer-combine based pseudocode is possible.
[10]

⇐⇒ ⇐⇒ ⇐⇒

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