Binary Tree in Java - 21: Check if two binary trees are identical

preview_player
Показать описание

In this video, we're going to reveal exact steps to check if two binary tree are identical in java

Please check video for more info:

CHECK OUT CODING SIMPLIFIED

★☆★ VIEW THE BLOG POST: ★☆★

I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 200+ videos.

★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★

★☆★ Send us mail at: ★☆★

This problem is similar to following:
check if two binary tree are identical in java,
check if two binary tree are identical,
if two binary tree are identical in java
binary tree,
java tutorial,
coding simplified,
java
Рекомендации по теме
Комментарии
Автор

Your 2nd condition is not correct. It should be (node1 == null && node2 != null) && (node1 != null && node2 == null). then return false. You also mention it in the video. Maybe it's a typo. Thanks for the explanation by the way.

mdshafi
Автор

This code not work on gfg for
R1-> 177
R2-> 177 N 140 N 182 N 83

rajeshlohar
Автор

Sir which one is best approach inorder, preorder or postorder ?

santhosh
Автор

Sir can we check it with their levelorder ...i.e. sir if the level order of the tree is same then it will be identical

kumarakash