Part 12 of 15 in Binary Trees  

Determine if two binary trees are identical. by animeshn

Problem statement

Two binary trees are identical if they have same data at root node and identical left and right sub-trees. Compare two binary trees and determine whether they are identical or not.


You need to write a function named "CompareBinaryTrees" that will take pointers to the roots of two binary trees as argument.


Your function must return 1 if trees are identical, 0 otherwise.

To try out your code

Sign in

Sign up