Thursday, August 20, 2009

TWO MARKS QUESTIONS AND ANSWERS

DATA STRUCTURES



41 Define tree?
Trees are non-liner data structure, which is used to store data items in a shorted sequence. It represents any hierarchical relationship between any data Item. It is a collection of nodes, which has a distinguish node called the root and zero or more non-empty sub trees T1, T2,….Tk. each of which are connected by a directed edge from the root.


42 Define Height of tree?
The height of n is the length of the longest path from root to a leaf. Thus all leaves have height zero. The height of a tree is equal to a height of a root.


43 Define Depth of tree?
For any node n, the depth of n is the length of the unique path from the root to node n. Thus for a root the depth is always zero.


44 Define Degree of a node?
It is the number of sub trees of a node in a given tree.


45 define Degree of a tree?
It is the maximum degree of a node in a given tree.


46.Define Terminal node or leaf?
Nodes with no children are known as leaves. A leaf will always have degree zero and is also called as terminal node.


47. Define Non-terminal node?
Any node except the root node whose degree is a non-zero value is called as a non-terminal node. Non-terminal nodes are the intermediate nodes in traversing the given tree from its root node to the terminal node.


48.Define sibling?
Nodes with the same parent are called siblings.


49.Define binary tree?
A Binary tree is a finite set of data items which is either empty or consists of a single item called root and two disjoin binary trees called left sub tree max degree of any node is two.


50.Define expression tree?
Expression tree is also a binary tree in which the leafs terminal nodes or operands and non-terminal intermediate nodes are operators used for traversal.

No comments:

Post a Comment