23-01-2013, 10:44 AM
Design of Algorithms Question paper
1Design of Algorithms.pdf (Size: 272.73 KB / Downloads: 30)
1. Find the time complexity of following one
13 + 23 + 33 + ….. + n3
A. O(2n)
B. O(n3)
C. O(n3 log n)
D. O(n4)
E. None
2. If there are n nodes in full binary tree then how many leaf nodes will be present in that tree?
A. 2n – 1
B. log n 2 (log n base 2)
C. n/2
D. (n+1)/2
E. (n-1)/2
F. n/2
G. None
3. What is the time complexity to insert an element in priority queue (implemented with two queues ) when it is unsorted.
A. O(1)
B. O(n2)
C. O(log n)
D. O(n)
E. None
4. All complete Binary trees are full binary trees
A. True
B. False
5. How many elements will be sorted at Nth pass in selection sort (choose appropriate one )
A. N-1 elements
B. N elements
C. N+1 elements
D. More than are equal to N elements
E. less than are equal to N elements
F. None
6. What is the root and height of the AVL tree for the following data?
40 30 50 35 25 15 60 55 70.
A. 40, 2 respectively
B. 30,4 respectively
C. 30,3 respectively
D. None
7. What is the pre order traversal for following post order traversal
45, 50, 40, 65, 70, 60, 55
A. 55, 40,50,45, 60, 70,65
B. 55,40,45,50,65,60,70
C. 55,40,45,50,60,65,70
D. 55, 40,45,50, 60, 70,65
E. None
8. Every node in a B-tree has at most, how many children it would have__________
(Assume order of B-tree is M)
A. M
B. M-1
C. 2
D. 2M
E. None