Showing posts sorted by relevance for query binary tree. Sort by date Show all posts
Showing posts sorted by relevance for query binary tree. Sort by date Show all posts

Counting nodes in a tree? Yes how to get Binary Tree size

Counting nodes in a tree? Yes how to get Binary Tree size nothing but counting all the nodes in a Binary Tree. For example the size of the below binary tree is 11 Lets...

Convert a Binary Tree into its Mirror Tree

Mirror of a Tree: Mirror of a Binary Tree T is another Binary Tree M(T) with left and right children of all non-leaf nodes interchanged as given below example. public class MirroringBinaryTree { class...

Cool !!! How to find the diameter of a binary tree

Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree....

How to do Iterative Postorder Traversal in BST

Earlier we have seen lot of tutorials related to Binary Search Tree like How to find the diameter of a binary tree Converting a Binary Tree into its Mirror Tree Inorder Predecessor and Successor...

How to get height of BST using recursive way

The height of a Binary Search Tree is the length of the longest downward path to a leaf from root node. This is commonly needed in the manipulation of the various self-balancing trees, AVL...

Create Binary Tree - Preorder, Inorder and Postorder Traversal

Lets see simple java code to create Binary Tree and all 3 traversals like Preorder, Inorder and Postorder. Used 2 classes called BST (used for binary tree node) and BinaryTree to construct Binary Tree and...