You are on page 1of 2

# 1. What is binary search tree (BST) is all about?

Binary search tree is a binary tree in which each internal node x
stores an element such that the element stored in the left subtree of
x are less than or equal to x and elements stored in the right
subtree of x are greater than or equal to x.
2. Explain 3 types of binary tree.
a) Preorder traversal
b) Inorder traversal
c) Postorder traversal
3. Explain about the traversal in binary tree (Inorder, preorder
and postorder).
a) Preorder traversal
i. Start form the root node. Write it down
ii.
Then go to the leftmost node from the root node in the
left subtree. On its way to the left most node, right down
all the nodes as it comes.
iii.
When the leftmost node is reached, write it down
iv.
Then visit the right subtree of the leftmost node’s parent
node.
v. Write down the first node of the right subtree
vi.
Now proceed in the same way as step ii – v till ‘writing
down’ of all the nodes is finished.
b) Inorder traversal
i. Start form the root node
ii.
Then go to the leftmost node from the root node in the
left subtree.
iii.
When the leftmost node is reaches, write it down.
iv.
Then visit/go to the leftmost node’s parent node. Write it
down.
v. Then visit/go to the first node of the right subtree.
vi.
Proceed in the same way as in step ii – v till ‘writing
down’ of all the node is finished.
c) Postorder traversal
i. Start from the root.
ii.
The go to the leftmost node from the root node in the
left subtree.
iii.
When the leftmost node is reached, write it down.
iv.
Then visit/go to the leftmost node’s parent node.
v. Then visit/o to the first node of the right subtree.

4. b) Complete binary tree:  Complete binary tree is a binary tree in which every level.vi.  So no leaves with only one child. What is the difference between a full binary tree and a complete binary tree? a) Full binary tree:  A full binary tree is a tree in which every node other tan the leaves has two children. Proceed in the same way as in step ii – v till ‘writing down’ of all nodes is finished. . is completely filled and all nodes are as far left as possible. except possibly the last.  It seems to mean a balanced tree. usually distinguished as “left” and “right”. A binary tree is a tree data structure in which each node has at most two child nodes.