would this work:
if (node1.value != node2.value)
return false;
if(node1 != null && node2 != null)
{
if(node1.leftChild.value == node2.leftChild.value)
isIsomorphic(node1.leftChild, node2.leftChild)
else if(node1.leftChild.value == node2.rightChild.value)
isIsomorphic(node1.leftChild, node2.rightChild)
if(node1.rightChild.value == node2.leftChild.value)
isIsomorphic(node1.rightChild, node2.leftChild)
else if(node1.rightChild.value == node2.rightChild.value)
isIsomorphic(node1.rightChild, node2.rightChild)
}
return true;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---