Study Abroad Education Loan College News Placement Book Shops E - Books Engg-Admission Edu-Classifieds Students-Forum
Easy Studies
 « NS2  Projects »

Home Implementation Of Binary Tree Traversing▼

Implementation Of Binary Tree Traversing:

Binary tree traversing:

Definition:

It is a most common operation in binary tree. (i.e. pass through the tree). Enumerating each of its nodes once. It is generally known as of visiting each node at once.

Three type of traversing orders:

1. Preorder traversing.

2. Inorder traversing.

3. Postoredr traversing.

Algorithm Steps:

Step1: Builds the binary tree.

Step 2: Determain the tree is non empty.

Step 3: Traversing type is preorder (depth-first order) then perform the following   operations.

1. Visit the root.

2. Traverse the left subtree in preorder.

3. Traverse the right subtree in preorder.

Step 4: Traversing type is inorder (symmetric order) then performing the following operations.

1. Traverse the left subtree in inorder.

2. Visit the root.

3. Traverse the right subtree in inorder.

Step 5: Traversing type is postorder then performing the following operations.

1. Traverse the left subtree in postorder.

2.  Traverse the right subtree in postorder.

3.  Visit the root.

C Program To Implement Binary Tree Traversing

⇓ Student Projects ⇓
⇑ Student Projects ⇑