Largest BST Subtree - Solution | Binary Trees | Data Structure and Algorithms in JAVA

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

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

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

    No one gets this much deeper into question unless he is Sumeet Sir.🔥🔥

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

      Thank you so much and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @a.techsys9389
    @a.techsys9389 2 ปีที่แล้ว +4

    I was going for greeks of greeks , but after lot of internet search, i found prepcoding (more solutions, easy to understand sir lecture) just awesome
    Thanks sir 😄

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

      Greeks?! 😂😂

    • @mrprime557
      @mrprime557 ปีที่แล้ว

      tu chutiya of chutiya ko dhek howla madarchod

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

    Sir ji, you are great! Your patience & dedication is appreciable. There's a lot to learn from you. Thanks!

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

      Thankyou beta for being our constant supporter.
      I am glad you liked it. I also hope that you are watching till the end and trying to understand the what, how, and especially why of the problem. If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

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

    I just get amazed every time i see Sumeet sir explaining things, hatsoff to you sir.

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

    Bhai Explaination toh kadak hota hai tumhara, thanks a lot. If i search any problem in youtube to understand and your video is in result, no need to open any other video. I kind of get that comfortable feeling "are bhai ne samjha k video dala hua hai, ho gaya kaam, lets play"

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

      Glad to know that you liked the content and thank you for appreciating.
      The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
      So, keep motivating, keep learning and keep loving Pepcoding😊

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

    Thank you Sir
    Was able to solve all Binary tree questions on Leetcode (easy medium hard) after understanding the game.

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

      Hope it was helpful.
      For better experience and curated content sign up on nados.io

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

    Thank you so much sir for a great explanation and clearing both concepts i.e. Travel and change as well as modifying pair class to solve different tree questions. I am able to come up with at least one solution using any one of the approach before even looking at solution.

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

    gajab explanation sir!! aap bohot enthusiastic hain.. mere college ke teachers ka combined enthusiasm toh negative me jata hoga😂

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

      Beta, aise nh bolte. Teachers saare he bdiya hote h, kami hmare andar hoti h. Yha aap interest show krte ho aur mjhe pyaar dete ho, issiliye main motivate ho k aacha content deliver kr pata hu aap logo ko.
      Keep learning, keep motivating and keep loving Pepcoding😊

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

    Never thought binary trees would be that much easy , thank you sir, waiting for the next topic😀

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

      Keep watching. Please subscribe the channel and press the bell notification. Also, share the channel in your college groups.

  • @AshwaniSharma-zw6wq
    @AshwaniSharma-zw6wq 3 ปีที่แล้ว +2

    what an explanation ! Awesome Sir ji🔥

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

      Thanks for liking and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

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

    Sir thanku so much umeed agyi zindagi m ab apse connected rhuga

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

      aapko roadies salute diya jata hai. just kidding. :-P

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

      Sir nhi smjhe

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

      arey aise he mze kar rhe hain yar. padhte rahie. hum bnate rahenge.

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

    Best explanation 🫡🫡

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

    Sir logic soch liya tha revision ker rha hu sir notes bnaker to vidow solution dekhte huwe notes bna rha hu kyoki sir revision kerke dimag me Sare question kerke patterns banunga uske bad level 2 ke sare question pe bahut sara time invest kerunga

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

    what the explanation sir ji....your videos helps me a lot to get dedication towards questions.
    thank you

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

      Thankyou beta!
      I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc

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

    Sir.. pehle question karne ka man nhi hota tha.. but app ki videos dekhne k baad khud se question krne ka man hota h.maine paid course liya h but vo aapke ki tarah nhi padhate .. maine video app ki dekhta aur question unse puchta hu..

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

      Are Bhai koi nhi sir ke hi student hai jo pda rhe hai jo sir ne btaya whi bta rhe honge usme koi dikket nhi hai sir ki addat ho gyi hai apko wo sir se alag nhi btayenge

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

    Shouldn't the correct answer for failing test be 50@11 as complete tree is BST ?

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

      Complete tree is not BST. The maximum on left subtree is 51 which is greater than 50

  • @Phoenix-xi2gy
    @Phoenix-xi2gy 3 ปีที่แล้ว +1

    Sir ek doubt tha... Ye last ke 3 questions jo Pair strategy pe based h .. Inke Iterative implementations bhi puche jaa skte h?

  • @火影-z9r
    @火影-z9r 4 ปีที่แล้ว +3

    nice content and easy explanation

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

      Glad you liked it

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

    14:27 sir jab aapne bola na ki ye baat yaha smjh ni ayegi , ushi time sab smjh aaya

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

    Thanks!

  • @118_ruchirjain7
    @118_ruchirjain7 2 ปีที่แล้ว

    null pointer exception deta hai yeh code jab pair lp=isbst(root.left) pr

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

      For better insight, visit nados.pepcoding.com, post your doubts, community will help you out there.

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

    bhaiyya aap node.data = use kar rhe ho lekin BST mein to sare nodes unique hone ki jarurat hai na sir ?

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

      hanji. dhyaan nahi rha. hta dijie =

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

    Sir, Time Complexity O(n) hogi ya ye galat hai?

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

    Great explaination 🙏🏿

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

      Thankyou beta!
      I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
      If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

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

    But sir in last test case if 25 and 75 both are BST then whole tree should be BST...so Answer should be 50@11...not 75@5 or 25@5

    • @a.techsys9389
      @a.techsys9389 2 ปีที่แล้ว +1

      Nahi
      50 is root node
      If you check left bst contain 51
      So 50 is not greater than 51 that mean from 50 is not bt node
      That's why there are 2 BST

  • @shikhasingh-vn7yt
    @shikhasingh-vn7yt 3 ปีที่แล้ว

    Wahhh sir kamalkar diya

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

      I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
      If you like our efforts, we request a review
      g.page/Pepcoding/review?rc
      You can subscribe to our channel here
      th-cam.com/users/Pepcodingabout?view_as=subscriber

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

    for the wrong test case when the ln and the rn both holds bst property and 50 itself hold the bst property then the entire tree must be a bst, isn't the largest bst subtree the root node itself?
    if it is, the code had to print 50, it printed 75 why?
    if my insight is wrong plz correct me,it would be a great help to me.
    Thank you

    • @AmanKumar-jt9zb
      @AmanKumar-jt9zb 3 ปีที่แล้ว +1

      the answer is not 50 because 25 is bst as a tree and as a node similarly 75 too but when you will compare it with 50 they both satisfy the condition but for 50 to be a bst it must be greater than the max of all nodes in left subtree but in this case 51 comes under the left child of 50 which is greater than 50 so 50 will not be considered as bst node and hence the answert 25 and 75 both are correct but not 50.....Hope its clear

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

      @@AmanKumar-jt9zb yes sir it's clear,thank you for the clarification,i missed that 51 that you have pointed out. Thank you very much

    • @AmanKumar-jt9zb
      @AmanKumar-jt9zb 3 ปีที่แล้ว +1

      @@samiulkhan3744 bhai i m also a student yrr

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

    Thank you very much sir

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

    sir aap boht achha padhate ho bss ye meme pareshan krte hai beech beech mai
    no offense please

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

    Bhai saab aao samjhate bhot mast ho..

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

      If you like our efforts, we request a review
      g.page/Pepcoding/review?rc
      You can subscribe to our channel here
      th-cam.com/users/Pepcodingabout?view_as=subscriber
      For clearing your doubts, you can join our community on telegram
      t.me/pepcoding

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

    Mja aa gya❣️

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

      Keep learning, Keep growing and keep loving Pepcoding!😊

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

    Aapreteem (behtreen)

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

      Glad you liked it!
      Keep learning.
      And for better experience, visit nados.io, where you will get well curated content and career opportunities.

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

    Bhaari sawal h

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

    super sir.....

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

      Thank you so much. If you like the content, please share and subscribe

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

    That annoying sound of current is not allowing to focus

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

    there are some cases that you have not cover

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

    khud solve kiya yeh

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

      Bhot he bdiya beta, aise he lge rho aur har question ko phle khud se krne ka he try kiya kro but jab ek moment pr aa k lge ki ab nahi chl rh dimaag to tab refer kr lo solution.

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

      @@Pepcoding haan sir