DAA2
DAA2
Design and analysis of algorithms is an important field of computer science that focuses on the study of
efficient ways to solve a problem.
The goal of design and analysis is to create an efficient algorithm, or series of steps, that can be used to
solve a given problem in the most effective way possible.
Analysts identify which operations are necessary for solving the problem, determine the data structures
required, then design a sequence of steps needed to achieve the desired outcome.
The process begins with choosing an appropriate algorithm from a set of known algorithms based on its
complexity and efficiency.
Then, analysts analyze how each step works together with other components within the program in
order to ensure that it runs as intended. Further analysis may include studying any potential errors or
bugs associated with certain implementation techniques or coding styles.
Design and analysis of algorithms multiple choice questions with answers pdf
a) Compile
b) Run
c) Execution
Ans: A
b) Semantically
c) Syntactically or semantically
Ans: C
a) 0
b) 1
c) 2
d) 3
Ans: A
4) O(n) is ___
a) Linear
b) Quadrate
c) Cubic
d) Exponential
Ans: A
5) (n2 ) is ___.
a) Linear
b) Quadratic
c) Cubic
d) Exponential
Ans: A
6) (n3 ) is ___ .
a) Linear
b) Quadratic
c) Cubic
d) Exponential
Ans: B
7) (2n) is ___ .
a) Linear
b) Quadratic
c) Cubic
d) Exponential
Ans: B
a) Binary
b) Completely Binary
Ans: B
b) Indirectly
c) Both a and b
Ans: B
a) Directly
b) Indirectly
c) Both a and b
Ans: A
11) If these are n elements in the heap inserting a new element tales ___ time in the work case.
a) Q (logn)
b) (logn)
c) Ω (logn)
d) Ω (n)
Ans: B
12) If these are n elements in a heap, deleting the maximum can be done in ___ these.
a) Q (logn)
b) (logn)
c) Ω (logn)
d) Ω (n)
Ans: A
a) (logn)
b) (n2)
c) (nlogn)
d) (n)
Ans: B
14) A data structure is known as ___ in which a location of an item is determined directly as a function
of the item itself, rather than a sequence of trial and error comparisons.
a) Arrays
b) Linked list
c) Hash table
d) Stock
Ans: C
a) (n)
b) (n2)
c) (nlogn)
d) (I)
Ans: C
16) The time required to locate an item in a hash table is ___ of the number of items in the list.
a) Independent
b) Dependent
c) Both a and b
Ans: D
a) (n)
b) (n logn)
c) (n2)
d) (logn)
Ans: A
a) (n2)
b) (n logn)
c) (n)
d) (logn)
Ans: C
a) (n2)
b) (n logn)
c) (n)
d) (logn)
Ans: B
a) (n)
b) ( logn)
c) (n logn)
d) (n2)
Ans: A
b) S (n) = E/n+1
c) S (n) = n+1/n2
d) S (n) =2(n+1)/n
Ans: B
a) U (n) = E+ 1/n
b) U (n) = 1+ 1/n
c) U (n) = E/n+1
d) U (n) =n+1/n2
Ans: A
b) Feasible
c) Union
Ans: A
24) In the greedy method ___ a combines X with the solution and updates the objective function.
a) Select
b) Feasible
c) Union
Ans: B
(a) Σ d (lj) O ≤ j ≤m
Ans: C
a) (n logn)
b) (logn)
c) (n)
d) (n2)
Ans: B
27) The worst case computing time for the job sequencing with deadlines is ___.
a) (n logn)
b) (logn)
c) (n)
d) (n2)
Ans: C
a) (n logn)
b) (n2)
c) (n)
d) (logn)
Ans: D
29) The greedy method for optimal merge pattern has ___ computing time for the tree.
a) (n2)
b) (n logn)
c) (n)
d) (n3)
Ans: A
Ans: B
Ans: A
a) A Program.
b) An Algorithm.
c) A single Instruction.
Ans: A
a) Sequence
b) Selection
c) Iteration
a) Condition.
b) Parameter.
c) Return Statement.
d) Header.
Ans: D
a) Program Execution.
b) Processing.
c) Requirements.
Ans: B
36) A linear collection of data elements where the linear node is given by means of the pointer is
called____.
a) Linked List.
b) Node List.
c) Primitive list.
d) None of these.
Ans: A
a) (n2).
b) (2n).
c) (nlogn).
Ans: A
38) A tree is height-balanced if the heights of the left and right subtrees of each node are within?
a) 0.
b) 1.
c) 2.
Ans: B
39) The nth element from the top of the stack S is accessible as:
a) S [Top-n].
b) S [Top + n].
c) S [Top –n –1].
Ans: B
a) M to n.
b) N to m.
Ans: A
a) Nodes.
b) Edges.
c) Direction of Edges.
d) Parallel edges.
Ans: A
a) Priority Queue.
b) Circular Queue.
c) Normal Queue.
Ans: A
a) Adjacency matrix
b) Edge listing
c) Adjacency list
Ans: D
44) Sorting is not possible by using which of the following methods?
a) Insertion
b) Selection
c) Exchange
d) Deletion
Ans: D
a) -20
b) 19
c) 21
Ans: C
a) 1014
b) 1016
c) 1113
Ans: A
47) There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full
binary tree?
a) 8
b) 15
c) 13
d) 14
Ans: B
48) Of the following tree structure, which is, efficient considering space and time complexities?
Ans: B
49) Does the minimum spanning tree of a graph give the shortest distance between any 2 specified
nodes?
a) Yes
b) No
d) Can’t say.
Ans: B
a) If the ‘pivotal value’ (or the ‘Height factor’) is greater than 1 or less than –1.
b) If the ‘pivotal value’ (or the ‘Height factor’) is greater than 2 or less than –2.
c) If the ‘pivotal value’ (or the ‘Height factor’) is greater than 3 or less than –3.
Ans: A