Professional Documents
Culture Documents
5. A binary tree whose every node has either zero or two children is called
Answers
**1. Complete binary tree
2. Binary search tree
3. Extended binary tree
4. None of above
6. Given an adjacency matrix A = [ [0, 1, 1], [1, 0, 1], [1, 1, 0] ], The total no.
of ways in which every vertex can walk to itself using 2 edges is ________
Answers
1. 2
2. 4
**3. 6
4. 8
7. Assume that a structure for a Binary Search Tree exists. What does the following
function do?
int function(root)
{
current = root;
while (current->left != NULL)
{
current = current->left;
}
return(current->data);
}
Answers
**1. Left most child of BST.
2. Right most child of BST.
3. subtrees of BST
4. None above mentioned
9. The post order traversal of binary tree is DEBFCA. Find out the pre order
traversal.
Answers
1. ABFCDE
2. ADBFEC
**3. ABDECF
4. ABDCEF