Driver code
int main ( ) { node * root1 = newNode ( 1 ) ; node * root2 = newNode ( 1 ) ; root1 -> left = newNode ( 2 ) ; root1 -> right = newNode ( 3 ) ; root1 -> left -> left = newNode ( 4 ) ; root1 -> left -> right = newNode ( 5 ) ; root2 -> left = newNode ( 2 ) ; root2 -> right = newNode ( 3 ) ; root2 -> left -> left = newNode ( 4 ) ; root2 -> left -> right = newNode ( 5 ) ; if ( identicalTrees ( root1 , root2 ) ) cout << " Both ▁ tree ▁ are ▁ identical . " ; else cout << " Trees ▁ are ▁ not ▁ identical . " ; return 0 ; }