WorksheetsEC8393-FDS-WEEKLY TEST 5
Total questions: 30
Worksheet time: 15mins
The number of edges from the root to the node is called __________ of the tree.
a) Height
b) Depth
c) Length
d) Width
The number of edges from the node to the deepest leaf is called _________ of the tree.
a) Height
b) Depth
c) Length
d) Width
What is a full binary tree?
a) Each node has exactly zero or two children
b) Each node has exactly two children
c) All the leaves are at the same level
d) Each node has exactly one or two children
What is a complete binary tree?
a) Each node has exactly zero or two children
b) A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left
c) A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right
d) A tree In which all nodes have degree 2
In preorder traversal of a binary tree the second step is ____________
a) traverse the right subtree
b) traverse the left subtree
c) traverse right subtree and visit the root
d) visit the root
In a binary search tree, which of the following traversals would print the numbers in the ascending order?
a) Level-order traversal
b) Pre-order traversal
c) Post-order traversal
d) In-order traversal
The height of a BST is given as h. Consider the height of the tree as the no. of edges in the longest path from root to the leaf. The maximum no. of nodes possible in the tree is?
a) 2h-1 -1
b) 2h+1 -1
c) 2h +1
d) 2h-1 +1
Which of the following statement about binary tree is CORRECT?
a) Every binary tree is either complete or full
b) Every complete binary tree is also a full binary tree
c) Every full binary tree is also a complete binary tree
d) A binary tree cannot be both complete and full
If a node having two children is to be deleted from binary search tree, it is replaced by its
a) In-order predecessor
b) In-order successor
c) Pre-order predecessor
d) None
What is the speciality about the inorder traversal of a binary search tree?
a) It traverses in a non increasing order
b) It traverses in an increasing order
c) It traverses in a random fashion
d) It traverses based on priority of the node
Which of the following pairs of traversals is not sufficient to build a binary tree from the given
traversals?
(A)Preorder and Inorder
(B)Preorder and Postorder
(C)Inorder and Postorder
(D)None of the Above
A Binary Tree can have
2 children
1 children
0 children
All the above
Height of Height of a binary tree is
MAX( Height of left Subtree, Height of right subtree)+1
MAX( Height of left Subtree, Height of right subtree)
MAX( Height of left Subtree, Height of right subtree)-1
None
In a full binary tree if there are L leaves, then total number of nodes N are?
a) N = 2*L
b) N = L + 1
c) N = L – 1
d) N = 2*L – 1
…………………. of binary search tree starts by visiting the current node, then its left child and then its right child.
A) Preorder traversal
B) In-order traversal
C) Linear traversal
D) Post-order traversal
Which of the following statement about binary tree is true
Every binary tree is either full or complete
Every complete binary tree is also a full binary tree
Every full binary tree is also a complete binary tree
None
The term Push and Pop is related to
A Queue
B Stack
C Both
D.None
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
a) ABCD
b) DCBA
c) DCAB
d) ABDC
In which data structure element is inserted at one end called Rear and deleted at other end called Front.
A Stack
B Queue
C Both
D Binary Tree
Stack can be implemented using _________ and ________ ?
A Array and Binary Tree
B Linked List and Graph
C Array and Linked List
D Queue and Linked List
A normal queue, if implemented using an array of size MAX_SIZE, gets full when
a) Rear = MAX_SIZE – 1
b) Front = (rear + 1)mod MAX_SIZE
c) Front = rear + 1
d) Rear = front
Insertion and Deletion operation in Queue is known as ?
A Push and Pop
B Enqueue and Dequeue
C Insert and Delete
D None
The postfix equivalent of the infix expression a+b/c*d−e/f is _____.
(a) ab+cd*/ef−/
(b) abcd*+/ef−/
(c) ab+cd*/ef/−
(d) abc/d*+ef/−
Which is/are the application(s) of stack?
(a) Function calls
(b) Parentheses check
(c) Evaluation of arithmetic expressions(
d) All of the above
The meaning of LIFO is _____ and it stands for _____.
(a) Last In First Out, Queue
(b) Last In First Out, Stack
(c) Last In Fast Out, Stack
(d) Last In First Out, Priority Queue
If the sequence of operations (push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop), are performed on a stack, the sequence of popped out values are _____.
(a) 2, 2, 1, 1, 2
(b) 2, 2, 1, 2, 2
(c) 2, 1, 2, 2, 1
(d) 2, 1, 2, 2, 2
Which of the following is false about a binary search tree?
a) The left child is always lesser than its parent
b) The right child is always greater than its parent
c) The left and right sub-trees should also be binary search trees
d) In order sequence gives decreasing order of elements
Which of the following statements about binary trees is NOT true?.
A. Every binary tree has at least one node
B. Every non-empty tree has exactly one root node.
C. Every node has at most two children.
D. Every non-root node has exactly one parent.
Is this a binary search tree?
55
/ \
17 60
/ \ / \
5 20 42 105
/ \ \
3 9. 55
Yes
No
NA
NA
Binary search tree is an example of complete binary tree with special attributes...
a.BST does not care about complete binary tree properties
b.BST takes care of complete binary tree properties
c.It depends upon the input.
d.None of the above.
