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

Daa 1

The document discusses algorithms and their analysis using Master's theorem. It covers topics like the different cases of Master's theorem, solving recurrences using it, time complexity analysis of various algorithms, and representation of algorithms as flowcharts, pseudocode or programs. There are multiple choice questions about these topics.

Uploaded by

Apoorva Rode
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)
11 views2 pages

Daa 1

The document discusses algorithms and their analysis using Master's theorem. It covers topics like the different cases of Master's theorem, solving recurrences using it, time complexity analysis of various algorithms, and representation of algorithms as flowcharts, pseudocode or programs. There are multiple choice questions about these topics.

Uploaded by

Apoorva Rode
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

A B C D Answer

1 Master’s theorem is used for? solving recurrences solving iterative relations analysing loops calculating the time complexity of any code solving recurrences
2 How many cases are there under Master’s theorem? 2 3 4 5 3
3 We can solve any recurrence by using Master’s theorem. TRUE FALSE FALSE
Under what case of Master's theorem will the recurrence
4 1 2 3 It cannot be solved using master’s theorem 2
relation of merge sort fall?
Under what case of Master's theorem will the recurrence
5 1 2 3 It cannot be solved using master’s theorem 2
relation of binary search fall?
The time complexity of recurrence relation T(n) = T(n/3) +
6 O(Ig n) O(n) O(n Ig n) O(n^2 ) O(n Ig n)
T(2n/3) + O(n) is
Which of the following case does not exist in complexity
7 Best case Worst case Average case Null case Null case
theory?
(1) find the characteristic (1) compute the solution (1) find the characteristic (1) find the characteristic
equation, (2) compute the coefficients, (2) find the equation, (2) find the roots (1) find the roots of the characteristic equation, equation, (2) find the roots of
Which is the correct order for the steps to find a solution of
8 solution coefficients, (3) characteristic equation, (3) of the characteristic (2) compute the solution coefficients, (3) find the characteristic equation, (3)
a homogeneous linear recurrence?
find the roots of the find the roots of the equation, (3) compute the the characteristic equation compute the solution
characteristic equation characteristic equation solution coefficients coefficients
If for an algorithm time complexity is given by O(1) then the
9 constant polynomial exponential none of the mentioned constant
complexity of it is ____________
Out of the following which property algorithms does not
10 Input Finiteness Generality Constancy Constancy
share?
11 Two main measures for the efficiency of an algorithm are Processor and memory Complexity and capacity Time and space Data and space Time and space

Solve the following recurrence using Master’s theorem.


12 T(n) = O(n (log n)^2) T(n) = O(n log n) T(n) = O(n^2log n) cannot be solved using master’s theorem T(n) = O(n (log n)^2)
T(n) = 4T (n/4) + n log n
A flowchart or Step by step instructions used to solve a Step by step instructions
13 What is an algorithm? A flowchart A decision
pseudocode problem used to solve a problem
Sequence, Selection, Input/Output, Decision,
14 What are the three algorithm constructions? Input, Output, Process Loop, Input/Output, Process Sequence, Selection, Repeat
Repeat Repeat
A flowchart is a
flowchart is a diagram A flowchart is a schematic
schematic description of
while the pseudocode is A flowchart is textual but description of an algorithm,
What is the difference between a flowchart and a an algorithm, while
15 written in a the pseudocode is a A flowchart and a pseudocode are the same while pseudocode is a
pseudocode? pseudocode is a textual
programming language diagram textual description of an
description of an
(e.g. Pascal or Java) algorithm.
algorithm.
In a flowchart, an input or output instruction is represented
16 diamond Rectangle Parallelogram A circle Parallelogram
by _____?
The timing factor to determine the efficiency of the Count the number of Counting the number of Count the number of
17 Counting microseconds Counting the kilobytes of the algorithm.
algorithm is measured by _____? operations declarations operations
The recurrence relation capturing the optimal time of the
18 T (n) = 2T (n – 2) + 2 T (n) = 2T (n – 1) + n T (n) = 2T (n / 2) + 1 T (n) = 2T (n – 1) + 1 T (n) = 2T (n – 1) + 1
Tower of Hanoi problem with n disks is _______?
When an algorithm is written in a programming language, it
19 flowchart program pseudo-code Syntax program
becomes a _________?
Which of the following statements is wrong? Algorithms
20 As pseudo codes As syntax As a program As a flowchart As syntax
can be represented:

If the hardware is used If the software is used If there is more than one If there is more than one
21 What should be considered when designing an algorithm? All the answers are true
correctly correctly way to solve the problem way to solve the problem
Only when we want to
At any time to design
22 When can we use algorithms? Only with computers Only when programming put our flowchart in At any time to design solutions to problems
solutions to problems
place.
What shape represents the beginning and end of a
23 Oval Rectangle Diamond Square Oval
flowchart?
Sometimes more
Much more complicated
Much easier to analyze complicated and Much more complicated to
24 The average case complexity of an algorithm is _______? to analyze than the None of the above
than the worst case sometimes simpler than analyze than the worst case
worst case
the worst case
The maximum memory The minimum memory The average memory size
The maximum disk space size required by The maximum memory size
25 Space factor is measured by ____? size required by the size required by the required by the
the algorithm required by the algorithm
algorithm algorithm algorithm
Recursion uses more memory space than iterations It uses the stack instead Each recursive call must Each recursive call must be
26 Both A and B are true. Aucune de ces réponses n’est vraie.
because _____? of the queue. be stored. stored.
The element is in the last
The worst case occurs in the linear search algorithm when The element is in the The element is not in the The element is in the last The element is in the last position of the
27 position of the array or it
________? middle of the array array position of the array array or it does not exist
does not exist
X will be a better choice X will be a better choice
What does it mean when we say that an algorithm X is X will be a better choice X will be a better choice for
28 for all except small for all except large Y will be a better choice for small entries
asymptotically more efficient than Y? for all inputs all except small entries
entries entries
For data collections
For relatively permanent For relatively permanent
29 Arrays are the best data structures whose structure is All the answers are true None of the above
data collections data collections
constantly changing
Consider the following for loops: If n is the size of the input,
30 for(i = 0; i < n; i++) for(i = 0; i < n; i += 2) for(i = 1; i < n; i *= 2) for(i = n; i < -1; i /= 2) for(i = 1; i < n; i *= 2)
which loop is more efficient?

You might also like