Height of Binary Tree | Height of a Binary Tree | Binary Tree Data Structure | DSA-One Course #57

Поділитися
Вставка
  • Опубліковано 8 лют 2025
  • Hey guys, In this video, We're going to solve a problem called Find the height of a binary Tree. The height of a Binary Tree is defined as the longest distance from the root node to any leaf node.
    📍Join my paid Java DSA course here: www.codingshut...
    📍Spring Boot 0 to 100 course: www.codingshut...
    📍React 0 to 100 course: www.codingshut...
    🚀 Follow me on:
    Instagram: / anuj.kumar.sharma
    Linkedin: / sharma-kumar-anuj
    X: x.com/sudoanuj
    Hashtags:
    #anujbhaiya #dsaone
    Tags:
    height of binary tree
    height of a binary tree
    height of tree
    height of a tree
    anuj bhaiya
    maximum depth of binary tree
    tree data structure
    binary tree in data structure
    binary tree
    binary tree height
    height of bst
    height
    height of trees
    tree in data structure
    tree data structure in java
    anuj bhaiya java
    binary tree java
    trees in data structure
    max depth of binary tree
    height and depth of binary tree
    tree dsa
    depth of binary tree
    diameter of binary tree
    tree height
    trees in dsa
    trees data structures and algorithms
    anuj bhaiya dsa
    binary search tree in data structure
    dsa
    height of the binary tree
    height of the tree
    tree
    tree in java
    trees data structures
    binary search tree
    binary trees in data structures
    height balanced tree
    tree in dsa
    tree traversal in data structure
    trees
    trees dsa
    104. maximum depth of binary tree
    anuj bhai
    anuj kumar sharma
    apna college
    binary search tree java
    binary tree in java
    binary tree traversal in data structure
    binary trees
    bst
    depth of a binary tree
    diameter of a binary tree
    dsa one
    full binary tree
    height and depth of tree
    height of binary search tree
    height using parent array
    kunal kushwaha

КОМЕНТАРІ • 78

  • @gwalaniarun
    @gwalaniarun 3 роки тому +27

    You are a blessing to us. Never stop this series, please.

  • @pragyanpandey662
    @pragyanpandey662 2 роки тому +10

    It's really commendable that after getting a well paid job at one of the dream company, Anuj Bhaiya has still given his efforts to continue working on this series and make other videos to help u. It's very easy to get those money and enjoy life, but to work this hard even after achieving great things, it is commendable.

  • @aswithasai4015
    @aswithasai4015 2 роки тому +10

    height is -1 for empty node i think it should be written return -1 when root is NULL.

  • @Anashwar-p3w
    @Anashwar-p3w 5 місяців тому

    by far the best explanation of this problem in whole youtube.

  • @venkatesh_21-d7y
    @venkatesh_21-d7y 2 роки тому

    Anuj bhaiya u r love ,u have made many people's life,u r so self-less ,u r posting this world class stuff to us for free,u r not only hardworking u r selfless,u r my hero,u r such a beautiful soul who give students quality teaching for freee and here are in my college who are asking for money for everything whether its coding or internship .U r real hero !!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @Lifeofkashh31
    @Lifeofkashh31 2 роки тому +2

    bhiya litrally i am thankful to u for this playlist yaar! This is sooooo dammm good Thankyou for so much hardwork!The most humble youtuber i have ever seen in my life!

  • @ArjunGupta-dj7ot
    @ArjunGupta-dj7ot 3 роки тому +6

    Thanks for being consistent, Really like your videos

  • @abirbanerjee839
    @abirbanerjee839 10 місяців тому

    THIS IS THE BEST VIDEO ON THE HEIGHT OF BINARY TREE

  • @Sagar__Raj
    @Sagar__Raj 3 роки тому +1

    Nice getting boost day by day by seeing ur videos

  • @kartikchauhan2778
    @kartikchauhan2778 2 роки тому +2

    excellent video bhaiya, call stack understood

  • @TheMdaliazhar
    @TheMdaliazhar 8 місяців тому

    I like your visual explanation better than any other youtuber. Please make more leetcode problem videos.

  • @nandiniverma5273
    @nandiniverma5273 2 роки тому +1

    Made soo easy to understand recursive call in this height.

  • @kajalkhirodkar6521
    @kajalkhirodkar6521 2 роки тому +2

    A very helpful video for understanding this concept. Thank you !!

  • @kcode4100
    @kcode4100 3 роки тому +2

    great work bhai keep it up 🤩🤩

  • @abantikakarmakar1988
    @abantikakarmakar1988 3 роки тому +2

    Thank you sir for your hardwork!!

  • @ramjeetkumar7212
    @ramjeetkumar7212 3 роки тому +1

    You tube er best job h

  • @himanshusinghparmar5816
    @himanshusinghparmar5816 2 роки тому

    Thank you and continue this series bhaiya
    God bless you

  • @riyazsayyad4047
    @riyazsayyad4047 2 роки тому

    Recursion me phas gya tha litreally, Thanks @Anuj Bhaiys

  • @nithinthota96
    @nithinthota96 3 місяці тому

    simply superb!

  • @RAMANKUMARGCEBIT
    @RAMANKUMARGCEBIT 2 роки тому +1

    thank u for the video. recursive callstack explanation was very good.

  • @Minecraftddgaming
    @Minecraftddgaming Рік тому +1

    after i listning recursion k deep me nhi jana hota hai upar upar se kr ke nikl jana hota hai >>>>> 3

  • @hannanhub1717
    @hannanhub1717 6 місяців тому

    very simple explanation

  • @bhushankorg5606
    @bhushankorg5606 2 роки тому +1

    Thanks!! very important concept.....

  • @Nitin12577
    @Nitin12577 2 роки тому

    it was very very good explanation

  • @richaofficial7638
    @richaofficial7638 3 роки тому +2

    Thank you
    Nice
    ❣❣

  • @tekno864
    @tekno864 3 роки тому

    Video is very very helpful !!!!!!!!!!!!!!!!
    Thanku bhaiya

  • @GahanaD
    @GahanaD 4 місяці тому

    Awesome☺☺☺🤯🤯

  • @softmedun6794
    @softmedun6794 Рік тому +1

    👉But sir single node ke lie to height 1 aa jayega jo ki galat hai , height 0 ana chahiye
    Isme ek or condition hona chahiye.......
    if(root->left ==nullptr && root->right==nullptr ){
    return 0;
    }

  • @vcs649
    @vcs649 2 роки тому

    wonderful explanation

  • @akshaykumar192
    @akshaykumar192 2 роки тому +1

    Bhaiya aapki video mujhe jaldi samaj aati hai

  • @THENIKSHOW-tp5hy
    @THENIKSHOW-tp5hy 4 місяці тому

    Thankyou ❤

  • @siddhigolatkar8558
    @siddhigolatkar8558 Рік тому

    Thank you

  • @youtubekumar8590
    @youtubekumar8590 3 роки тому +1

    Thanks bhaiya

  • @GauravKawatra-b5p
    @GauravKawatra-b5p Місяць тому

    Interviewer can ask for recursive call stack. Interviewer not assure about the understanding interviewee without recursive call stack.

  • @lokendrasingh9780
    @lokendrasingh9780 2 роки тому

    thank you bhaiya 🙏❤️

  • @SwayamBhoir-p4q
    @SwayamBhoir-p4q 2 місяці тому

    bhaiya, is there any algorithm to get the height of the tree without using recursion?

  • @lokanathpatasahani897
    @lokanathpatasahani897 3 роки тому +2

    Sir as a fresher I can apply in which positions in companies, like can I apply for jobs for freshers as well as in support Engineer role.
    Please 🙏 answer me.
    Because very few jobs are coming for freshers so can I apply for those positions in which it's asking for 1/2 years of experience if I have 1/2 good internships.

  • @arpanmaheshwari2290
    @arpanmaheshwari2290 3 роки тому +1

    Hum first!!

  • @tech_and_memes
    @tech_and_memes 2 роки тому

    got it bhaiya also practiced it on gfg

  • @pushparay5554
    @pushparay5554 3 роки тому

    Amazing❤

  • @balavardhanreddy8581
    @balavardhanreddy8581 Рік тому

    very greatful

  • @obaidurrahman7216
    @obaidurrahman7216 2 роки тому +1

    This code returns height is 3. Which is correct?

  • @bibekjoshi34
    @bibekjoshi34 Рік тому

    thanks

  • @deepikatripathi9269
    @deepikatripathi9269 2 роки тому +1

    Excuse me sir, what will be the height of the binary tree "if the root of the tree is 0" is mentioned?

    • @Gamer-uz7dl
      @Gamer-uz7dl 2 роки тому

      Just change return 0 to return -1

  • @RN-jo8zt
    @RN-jo8zt 11 місяців тому

    how come there are two defination for height of tree?

  • @basavarajhasarmani6231
    @basavarajhasarmani6231 Рік тому +1

    Height and depth of only one node in tree is zero(0) not (1)

    • @SaurabhPatel-w9b
      @SaurabhPatel-w9b 9 місяців тому

      Both are correct as per different books

    • @emanniaz7980
      @emanniaz7980 8 місяців тому

      Because he started indexing from 1 not 0 in most languages we start from 0 but in general we can use either 1 or 0

  • @saritaprasad4295
    @saritaprasad4295 2 роки тому

    good one

  • @abhijitchakraborty6035
    @abhijitchakraborty6035 2 роки тому +1

    Hi Anuj bhaiya, I guess the height of tree should be 3 not 4 because the height is given by the sum no. of edges in the binary tree. Please correct me if I am wrong.

  • @lokeshwarprasad9614
    @lokeshwarprasad9614 3 роки тому +1

    First ❤️❤️❤️

  • @akritirawat135
    @akritirawat135 Рік тому

    Height should be 3 no of edges from the root node...

  • @arjunkurariya2235
    @arjunkurariya2235 3 роки тому +2

    1st Comment ❤️❤️. Bhaiya muje Refferal dilwa doo pls. Meine 500+ DSA q. Solve kiye h. Help me🙏🙏

  • @amrish_kumar142
    @amrish_kumar142 3 роки тому +2

    Iteratiive bi bta dijiye

  • @Prakashvishwakarma1
    @Prakashvishwakarma1 3 роки тому +1

    Sir I'm BCA graduate and reactJS ki job mil rahi hi 5 hajar salary hi should I do job Or MCA?

    • @10daysAgo
      @10daysAgo 2 роки тому +2

      Bhai sirf 5 hazar ? Itna to tumhe ese hi koi pathology lab ke accounts department mein job se mil jayega . Infact atleast 12-15k to milenge hi . Lekin agar karna hi hai to experience ke liye karo 👍

  • @vikasprajapati6558
    @vikasprajapati6558 3 роки тому +1

    #DSAONE

  • @NitishShuklaOfficial
    @NitishShuklaOfficial 8 місяців тому

    best

  • @Headshot17Gaming
    @Headshot17Gaming 2 роки тому

    BHAIYA KYA PADATE HO YRR TUM MAJE AA GYE

  • @awesome-kl9ci
    @awesome-kl9ci 3 роки тому

    Bhaiya aage ki video kB nikalo gay

  • @vatsalyadubey641
    @vatsalyadubey641 2 роки тому

  • @sumitkumar-rj6ht
    @sumitkumar-rj6ht 9 місяців тому

    Start 0 to n ?

  • @dhananjaysingh3675
    @dhananjaysingh3675 3 роки тому

    👌👌🙏

  • @mahadishakkhor123
    @mahadishakkhor123 2 роки тому

    very helpful

  • @DhruvSharma-wb4li
    @DhruvSharma-wb4li 2 роки тому

    iski height 3nhi hogi kya?

  • @shiv_all_in_1
    @shiv_all_in_1 3 роки тому

    Bhai iss playlist ko jaldi khatam kro, waiting for Graph videos

  • @dekhbhai9328
    @dekhbhai9328 2 роки тому

    height 3 hai

  • @himanshusharma9239
    @himanshusharma9239 3 роки тому

    hi

  • @praveenvasu6960
    @praveenvasu6960 3 роки тому

    Bhai

  • @himanshusharma9239
    @himanshusharma9239 3 роки тому

    yo

  • @tarunkotla1856
    @tarunkotla1856 Рік тому +1

    amazing explanation

  • @Akash-dd6ev
    @Akash-dd6ev 2 роки тому

    Thank you bhaiyya

  • @adilhassan2093
    @adilhassan2093 2 роки тому +1

    Thank you bhaiya

  • @sujitojha6071
    @sujitojha6071 10 місяців тому +1

    thank you so much guru