Binary Tree - 37: Check if two Binary Trees are Isomorphic

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • Source Code:thecodingsimpl...
    Solution:
    - We need to check, if i move a node to left or right & it's matching with other tree
    - So other subtree can be same structure or mirror structure, then it's mirror structure
    - Recursively check left-left & right-right of both tree or check left-right & right-left
    - If both nodes are null, return true, if any one node is null, return false
    Do Watch video for more info
    This Problem is synonym of following problems:
    binary tree check if isomorphic tree,
    binary tree if two trees are isomorphic,
    check if isomorphic tree,
    binary tree check if both trees are isomorphic tree,
    Please check video for more info:
    CHECK OUT CODING SIMPLIFIED
    / codingsimplified
    ★☆★ VIEW THE BLOG POST: ★☆★
    thecodingsimpli...
    I started my TH-cam channel, Coding Simplified, during Dec of 2015.
    Since then, I've published over 200+ videos.
    ★☆★ SUBSCRIBE TO ME ON TH-cam: ★☆★
    www.youtube.co...
    ★☆★ Send us mail at: ★☆★
    Email: thecodingsimplified@gmail.com

ความคิดเห็น • 8

  • @piyushkumawat5114
    @piyushkumawat5114 2 ปีที่แล้ว

    Time complexity calcualtions are wrong

  • @realEngineer123
    @realEngineer123 3 ปีที่แล้ว

    sir iterative se kaise karenge

  • @fardilviews
    @fardilviews 4 ปีที่แล้ว +2

    thanks, dear,,,,, but request to make videos using c language,bcz everyone doesn't know about java , maximum know c programming

    • @CodingSimplified
      @CodingSimplified  4 ปีที่แล้ว +1

      Thanks for your suggestion Fardil, will try to create in C language as well.

  • @nagavarma7006
    @nagavarma7006 3 ปีที่แล้ว

    I got a doubt what if root node data for both the tree is not same still it shows true right???

    • @CodingSimplified
      @CodingSimplified  3 ปีที่แล้ว

      It will return false if root data doesn't matches. Let me know if it's not happening or you see any issue in it.

  • @vaibhavbangia7100
    @vaibhavbangia7100 4 ปีที่แล้ว +2

    👌👏