Unit-Iv Two Mark Questions
Unit-Iv Two Mark Questions
4. Define leaf?
In a directed tree any node which has out degree o is called a terminal node or a leaf.
5. What is a Binary tree?
A Binary tree is a finite set of elements that is either empty or is partitioned into three disjoint
subsets. The first subset contains a single element called the root of the tree. The other two
subsets are themselves binary trees called the left and right sub trees.
6. What are the applications of binary tree?
Binary tree is used in data processing.
a. File index schemes
b. Hierarchical database management system
7. What is meant by traversing?
Traversing a tree means processing it in such a way, that each node is visited only once.
8. What are the different types of traversing?
The different types of traversing are
a.Pre-order traversal-yields prefix form of expression.
b. In-order traversal-yields infix form of expression.
c. Post-order traversal-yields postfix form of expression.
9. What are the two methods of binary tree implementation?
Two methods to implement a binary tree are,
a. Linear representation.
b. Linked representation
10. Define Graph?
A graph G consist of a nonempty set V which is a set of nodes of the graph, a set E which is
the set of edges of the graph, and a mapping from the set for edge E to a set of pairs of elements
of V. It can also be represented as G=(V, E).
11. Define adjacent nodes?
Any two nodes which are connected by an edge in a graph are called adjacent nodes. For
Example, if and edge xÎE is associated with a pair of nodes (u,v) where u, v, then we say that the
edge x connects the nodes u and v.
12.Name the different ways of representing a graph?
a. Adjacency matrix
b. Adjacency list
13. What are the two traversal strategies used in traversing a graph?
a. Breadth first search
b. Depth first search
14. What is an acyclic graph?
A simple diagram which does not have any cycles is called an acyclic graph.
25. Show the maximum number of nodes in a binary tree of height H is 2H+1 – 1.
Consider H = 3
No. of nodes in a full binary tree = 2H+1 – 1
= 23+1 – 1
= 24 – 1
= 15 nodes
We know that a full binary tree with height h=3 has maximum 15 nodes. Hence proved.
26. List out the cases involved in deleting a node from a binary search tree.
Case 1: Node to be deleted is a Leaf node
Case 2: Node to be deleted has one child
Case:3: Node to be deleted has two children.
27. A + (B-C)*D+(E*F), if the above arithmetic expression is represented using a binary
tree, Find the number of non-leaf nodes in the tree.
Expression tree is a binary tree in which non – leaf nodes are operators and the leaf nodes
are operands. In the above example, we have 5 operators. Therefore the number of non-leaf
nodes in the tree is 5.
16 Mark Questions
1. Explain in detail the implementation of Binary Search Tree and perform its operations.
(May/June 2012).
2. Draw the binary search tree for the following input list 60, 25,75,15,50,66,33,44.
Trace an algorithm to delete the nodes 25, 75, 44 from the tree.
3. (i)State and explain the dynamic equivalence problem.
(ii)Explain the path compression algorithm and analyze the Union/Find algorithm used.
4. Explain the smart union algorithm.
5. Explain BFS and DFS with suitable examples.(Nov/Dec 2014).
6. Explain the various tree traversal and predict a binary tree with Preorder:ABCDEFGHI and
Inorder:BCAEDGHF (Nov/Dec 2011).
7. What is graph? What are the different ways for representing the graph?
8. Explain the two applications of trees with a neat example.
9. What are the types of tree traversal methods? Explain it with exam ple and routine.