NEW
Font size
WorksheetsEC8393_FDS_MODEL_EXAM_1_PART B
Total questions: 10
Worksheet time: 10mins
Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion?
5
2
3
4
The array is as follows: 1,2,3,6,8,10. At what time the element 6 is found? (By using linear search(recursive) algorithm)
4th call
3rd call
6th call
5th call
Apply Quick sort on a given sequence 7 11 14 6 9 4 3 12. What is the sequence after first phase, pivot is first element?
6 4 3 7 11 9 14 12
6 3 4 7 9 14 11 12
7 6 14 11 9 4 3 12
7 6 4 3 9 14 11 12
The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10 using open addressing with hash function h(k) = k mod 10 and linear probing. What is the resultant hash table?
A
B
C
D
The inorder and preorder traversal of a binary tree are d b e a f c g and a b d e c f g, respectively. The postorder traversal of the binary tree is _________.
d e b f g c a
d e f g b c a
e d b g f c a
d e b f g a c
Given two vertices in a graph s and t, which of the two traversals (BFS and DFS) can be used to find if there is path from s to t?
Only BFS
Only DFS
Both BFS and DFS
Neither BFS nor DFS
What is the result of the given postfix expression? abc*+ where a=1, b=2, c=3.
4
5
6
7
Evaluate the postfix expression ab + cd/- where a=5, b=4, c=9, d=3.
23
15
6
10
Consider the following rooted tree with the vertex P labeled as root ( Check Image)
The order in which the nodes are visited during in-order traversal is
SQPTRWUV
SQPTURWV
SQPTWUVR
SQPTRUWV
The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is
MNOPQR
NQMPOR
QMNPRO
QMNPOR
