Write an algorithm to determine if two binary trees areidentical when the ordering of the subtrees for a node is ignored.For example, if a tree has root node with value R, left child withvalue A and right child with value B, this would be consideredidentical to another tree with root node value R, left child valueB, and right child value A. Make the algorithm as efficient as youcan. Analyze your algorithm’s running time. How much harder wouldit be to make this algorithm work on a general tree?