Design and Analysis of Algorithms
Design and Analysis of Algorithms
Objective
1. The _______ of an algorithm is the amount of memory it needs to run to completion. [ ] a)Time
complexity b) Space complexity c) Memory Management. d) None
2. The solid edges of depth first spanning tree of the graph are called [ ]
a)Heavy edges b) Light edges c)Dark edges d)tree edges
3. Two biconnected components can have [ ]
a)at most one vertex in common b)at most two vertex in common
c)no common vertex d)at most one edge in common
4. Traversing a tree means [ ]
a) visiting each node in the tree strictly twice b)visiting each node in the tree three times
c) visiting each node in the tree exactly once d) visiting each node in the tree four times
5. The binary search is based on the following design technique [ ]
a) Greedy approach b) Graph Search
c) Divide and conquer technique d) Convergence Method.
6. The asymptotic analysis focuses on determining _____terms in the complexity function. [ ]
a) Smallest b) Average. c) Biggest d) Smallest or Biggest.
7. ________ is the maximum no. of steps that can be executed for a given parameter [ ]
a) Best case b) worst case c) Average case d) None
8. The number of times a statement is executed is usually referred as [ ]
a) Complexity b) Frequency count c) Both A & B d) None
9. Each path through the tree represents a Element Comparisons in the _______search. [ ]
a) Binary b) Linear c) Sequence d) None
10. _________ algorithm is used to construct Minimum Spanning Tree. [ ]
a) Prims b) Kruskals c) Optimal d) none
II Fill in the blanks
11. ___________ is a finite set of instructions that is followed ,accomplishes a particular task.
12. The time complexity of Strassens matrix multiplication is____________________
13. A feasible solution that either maximizes or minimizes a given objective function is called an
____________________
14. A graph G is biconnected if and only if it contains no_____________________.
15. _______________is the greedy method that bulids minimum-cost spanning tree edge by edge.
16. An optimal code for a file is always represented by a __________, in which every leaf node has
two children.
17. The time complexity for general matrix multiplication is __________________.
18. The operation Find(i) determines the ___________ of the tree containing i.
19. Merge sort has worst case time complexity ____________
20. The pictorial representation of Algorithm is called as ____________.
Answer All Questions. All Questions Carry Equal Marks.Time: 20 Min. Marks:
10.
I Choose the correct alternative:
1. The ______ of an algorithm is the amount of memory it needs to run to completion. [ ]
a) Time complexity b) Space complexity
c) Compile time complexity d) Valid complexity
2. The time complexity of the function 3n+2 is [ ]
2
18. O(n )
n-1
19. 2 2
20. N - 1
f(n) = 2
g(n) = n!
log n
h(n) = n
Which of the following statements about the asymptotic behavior of f(n), g(n) and h(n) is
true? [ ]
(A) f(n) = O(g(n)); g(n) = O(h(n)) (B) f(n) = (g(n)); g(n) = O(h(n))
(C ) g(n) = O(f(n)); h(n) = O(f(n)) (D)h(n)=O(f(n));g(n)=(f(n))
3. Function g is an upper bound on function f iff for all x, [ ]
(A) g(x) f (x) (B) g(x) f (x); (C) g(x) = f(x) (D) f(x)<g(x)
4. Time taken to perform (n-1) UNIONS is [ ]
2
12. O(n )
13. Collapsing rule
14. Breadth First
15. No Articulation Point
16. O(log n)
17. O (100)
18. Greedy Technique
19. Greedy Choice
20. Optimization