X
Write a Tutorial

Tutorials in Trees

Balanced Binary Tree


25 February, 12 0

This is an implementation of a Binary tree and it supports the following functions Insertion Deletion Search Preorder traversal Inorder traversal Postorder traversal Both recursive and iterative implementation are given for the traversals. It uses a Stack.h file, stacks are ...

Read more ...

Binary Search Tree


25 February, 12 0

The most difficult operation in a Binary Search Tree is the delete operation. So we suggest you read it carefully, for a further understanding of delete operation you can read the wiki article here #include < iostream > using namespace ...

Read more ...

Breadth Order Traversal


25 February, 12 0

Breadth order traversal is a very useful tree traversal, unlike depth order traversal, all the neighbors(or children in case of a tree) are visited before any node that lies below them. Breadth order traversal is used to find the shortest ...

Read more ...

Iterative Tree Traversals


25 February, 12 0

Tree traversals, are very important for any interview. Almost any interview question that you get, can be solved by finding out the correct traversal to use. You can read and compare various tree traversals from here . Although the recursive ...

Read more ...

Understanding Tree Traversing


23 March, 13 0

#include <iostream> using namespace std; struct node{ int val; node * right, * left; }; void main() { node *root; root = NULL; void Insert(node *root,const int& val) ; void InOrderTraversal(node *root); void preOrderTraversal(node *root); void PostOrderTraversal(node *root); int arr[10] ...

Read more ...