Refer to http://cslibrary.stanford.edu/110/BinaryTrees.html
void mirror(struct node* node) {
if (node==NULL) {
return;
}
else {
struct node* temp; // do the subtrees
mirror(node->left);
mirror(node->right); // swap the pointers in this node
temp = node->left;
node->left = node->right;
node->right = temp;
}
}
mirror image of the binary tree is nothing but it is the term used to swap the left and right subtrees of the bst... program or function of mirror image void mirror(tree *root) {if (root==NULL) return; else {temp=root->left; root->left=root->right; root->right=temp; } }
A binary tree is type of tree with finite number of elements and is divided into three main parts. the first part is called root of the tree and itself binary tree which exists towards left and right of the tree. There are a no. of binary trees and these are as follows : 1) rooted binary tree 2) full binary tree 3) perfect binary tree 4) complete binary tree 5) balanced binary tree 6) rooted complete binary tree
Is another binary tree.
Yes.
A binary tree variant that allows fast traversal: given a pointer to a node in a threaded tree, it is possible to cheaply find its in-order successor (and/or predecessor).
A full binary tree is a type of binary tree where each node has either 0 or 2 children. A complete binary tree is a binary tree where all levels are fully filled except possibly for the last level, which is filled from left to right. So, a full binary tree can be a complete binary tree, but not all complete binary trees are full binary trees.
will remain same
no they are not same
Check this out! http://stackoverflow.com/questions/575772/the-best-way-to-calculate-the-height-in-a-binary-search-tree-balancing-an-avl
To find the height of a binary tree, you can use a recursive algorithm that calculates the height of the left and right subtrees, and then returns the maximum height plus one. This process continues until the height of the entire tree is calculated.
What are the applications of Binary Tree.
a binary tree with only left sub trees is called as left skewed binary tree