Find Height of a Binary Tree using Recursive Function | Recursion approach | BST Implemenation | DSA

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024

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

  • @MuhammadAli-bf1rc
    @MuhammadAli-bf1rc 3 ปีที่แล้ว +3

    I have not seen youtuber like him, great work!
    No music no intro just the lecture.

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

    You're the best. I know recursive tracing takes a long time and can be annoying, but I really wish more professors would go through the processes like this.

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

    Amazing... I think no one can explain better than you...Thanks a lot sir..

  • @CricketLover-ok2pv
    @CricketLover-ok2pv 4 ปีที่แล้ว +3

    Bs Yehi Speed Se Upload Krte Rho Bhai
    Thank U ❤️

  • @manoj8374
    @manoj8374 3 ปีที่แล้ว +2

    The best explanation and the best presentation. The way you explain concepts is simply perfect

  • @user-jc6qm3gp7s
    @user-jc6qm3gp7s ปีที่แล้ว

    absolutely beautiful with the dry run for the pseudo code, you're a very articulate instructor. loved the tutorial!

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

    Approach to explain recursion is nice bro, it really makes more sense now

  • @nandigamadheeraj8881
    @nandigamadheeraj8881 4 ปีที่แล้ว +8

    Please Create some videos on templates, vectors , maps , iterators

  • @bulksouls6154
    @bulksouls6154 3 ปีที่แล้ว +1

    This video finally made it click for me. Thank you.

  • @goutham3663
    @goutham3663 2 ปีที่แล้ว +1

    Best explained I have seen for height of a tree.

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

    tanmay bro! you are doing such a very good hard work ......
    thank you so so so much

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

    Lovely explanation...thank you ❤❤❤

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

    He is a wonderful creator

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

    More compact version:
    int height(Tree *r)
    {
    if(r==NULL)
    return 0;
    return max(height(r->left)+1,height(r->right)+1);
    }

  • @prarambhiksur2104
    @prarambhiksur2104 4 ปีที่แล้ว +3

    Wonderful explanation bro. Keep it up!!
    Cheers✌✌

    • @SimpleSnippets
      @SimpleSnippets  4 ปีที่แล้ว

      Thank you so much 😀 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

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

    U are a Legend man Brother

  • @gamercumcoder2496
    @gamercumcoder2496 3 ปีที่แล้ว +1

    Underrated video.

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

    please make some videos on map vectors sets as we need them in cp please please

  • @viveksuman9600
    @viveksuman9600 3 ปีที่แล้ว +2

    Are we supposed to visualise this complex step by step process everytime we write recursion? Or just write recursion based on intution, getting some idea what it does but not knowing exactly how it does?

    • @SimpleSnippets
      @SimpleSnippets  3 ปีที่แล้ว +2

      I keep asking this question to myself 😅 I suppose you get the hang of it slowly as you keep practicing recursion based algorithms

    • @viveksuman9600
      @viveksuman9600 3 ปีที่แล้ว +2

      @@SimpleSnippets XD..Thanks !

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

    you are the best...............masum

  • @manishpatil8326
    @manishpatil8326 2 ปีที่แล้ว +1

    hey thanks perfect explanation

  • @rizwanahmed9413
    @rizwanahmed9413 3 ปีที่แล้ว +3

    sir can you please tell me why we use return -1 instead of return 0 in height function and return left + 1 or right + 1 instead of return left and right.

    • @SimpleSnippets
      @SimpleSnippets  3 ปีที่แล้ว +1

      Because height is one less than the levels. Try dry running the code and it should make sense.

    • @abdelrhmanahmed1378
      @abdelrhmanahmed1378 3 ปีที่แล้ว +1

      you can also think of it as, the height of the leaf node it self is 0 , so you return -1 for left node of the leaf node ,and -1 for the right node of the leaf node max(-1,-1)+1 --> 0 , so the height of leaf nodes is 0

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

    Best explanation ever

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

    🥲 thank you very much !!!

  • @DeepakSingh-le6di
    @DeepakSingh-le6di 3 ปีที่แล้ว +1

    also upload the left out approach for the codes

  • @aryantiwari-datascience5562
    @aryantiwari-datascience5562 3 ปีที่แล้ว +1

    SIR WHEN WILL YOU UPLOAD THE REMAINING VIDEOS CAN U TELL??

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

    Is the playlist complete

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

    waiting for the more videos sir

  • @HassanRaza-wy6pt
    @HassanRaza-wy6pt 2 ปีที่แล้ว

    In line 2.3 and 2.4, why not subtract them? Lh - rh gives the same answer does it not?

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

    nice explanation bro

  • @prachigoyal2438
    @prachigoyal2438 3 ปีที่แล้ว +1

    Can you please complete the dsa playlist asap. heaps hash tables and graphs

    • @SimpleSnippets
      @SimpleSnippets  3 ปีที่แล้ว +1

      Will try but it takes a lot of time

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

    Why we sent obj.root ??

  • @ibrahemnjr9924
    @ibrahemnjr9924 2 ปีที่แล้ว +1

    Thanks 🤍

  • @cmcatholic1798
    @cmcatholic1798 3 ปีที่แล้ว +1

    Very nice , thank you 😄😄

  • @ikhlasadely4556
    @ikhlasadely4556 3 ปีที่แล้ว +1

    thank you

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

    Mast laga

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

    Thank you, Sir

  • @motanveeralam2986
    @motanveeralam2986 3 ปีที่แล้ว +1

    thank you sir

  • @DhavalBirade
    @DhavalBirade 3 ปีที่แล้ว +1

    How to find specific node's height??

    • @SimpleSnippets
      @SimpleSnippets  3 ปีที่แล้ว +2

      Traverse till that node first and then call the height function

  • @ChinmayAnand-nt7du
    @ChinmayAnand-nt7du ปีที่แล้ว

    bhai height is 3 here not 2

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

    First viewer

  • @PIYUSH-lz1zq
    @PIYUSH-lz1zq 2 ปีที่แล้ว

    Height should be 3 !!

  • @fordalberto6692
    @fordalberto6692 4 ปีที่แล้ว

    My manager is the type of man that most people would like to invest with, he's not the best of all. But it's more about what he knows about the market and his predictions are accurate. You can try to see for yourself.