answersLogoWhite

0

Check Binary tree isomorphism

Updated: 9/14/2023
User Avatar

Wiki User

12y ago

Best Answer

//not sure if it is correct

bool isomorphic(struct Node* root1,struct Node* root2)

{

if(root1 root2->value)

return ( isomorphic(root1->left,root2->left) && isomorphic(root1->right,root2->right)

isomorphic(root1->right,root2->left) && isomorphic(root1->left,root2->right)

);

else return false;

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Check Binary tree isomorphism
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is meant by binary tree?

there is no shortcut for this anwer so in the related links box below I posted the wikipedia binary tree article. Check it out.


How to find height of subtree in a Binary tree?

Check this out! http://stackoverflow.com/questions/575772/the-best-way-to-calculate-the-height-in-a-binary-search-tree-balancing-an-avl


How many types of binary tree?

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


Are binary tree and binary tree same?

Yes.


Copy of binary tree?

Is another binary tree.


When converting binary tree into extended binary tree all the original nodes in binary tree are?

will remain same


Does binary tree and binary search tree same?

no they are not same


What are the application of binary tree in computer science?

What are the applications of Binary Tree.


What is meant by left skewed binary tree?

a binary tree with only left sub trees is called as left skewed binary tree


What is meant by tree based parity check?

It is one of the type of parity checking methods. when the binary digits are formated as like the binary tree .Then calculate the parity from the root to each leaf node from left to right.


What is incomplete binary tree?

Incomplete Binary Tree is a type of binary tree where we do not apply the following formula: 1. The Maximum number of nodes in a level is 2


What is the difference between strictly binary tree and complete binary tree?

Complete Binary tree: -All leaf nodes are found at the tree depth level -All nodes(non-leaf) have two children Strictly Binary tree: -Nodes can have 0 or 2 children