10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

The number of branches associated with a node is the degree of the node.<br />

When the branch is directed toward the node, it is an indegree branch; when<br />

the branch is directed away from the node, it is an outdegree branch.<br />

If the tree is not empty, the first node is called the root, which has the indegree<br />

of zero. A leaf is a node with an outdegree of zero.<br />

An internal node is a node which is neither the root nor a leaf. A node can be a<br />

parent, a child or both. Two or more nodes with the same parent are called<br />

siblings.<br />

A path is a sequence of nodes in which each node is adjacent to the next one.<br />

An ancestor is any node in the path from the root of a given node. A<br />

descendent is any node in all of the paths from a given node to a leaf.<br />

The level of a node is its distance from the root. The height of the tree is the<br />

level of the leaf in the longest path from the root plus one.<br />

A subtree is any connected structure below the root. A tree is a set of nodes<br />

that is:<br />

a. either empty<br />

b. or has a designated node called the root from which hierarchically<br />

descend zero or more subtrees which are also trees.<br />

BINARY TREES<br />

A binary trees is a tree in which no node can have more than two subtrees. In<br />

other words, a node can have zero, one or two subtrees. These subtrees are<br />

designated as the left subtree and right subtree.<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 180 ‐

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!