INORDER PREDECESSOR in Binary Search Tree

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

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

  • @ishan_kumar
    @ishan_kumar 5 ปีที่แล้ว +45

    Not all heroes wear capes some teach BSTs.

  • @sagardafle
    @sagardafle 7 ปีที่แล้ว +19

    Vivekanand Sir, you are just awesome.
    I love your dedication for uploading the videos almost daily.
    It is nice to see people from India having such keen interest in algorithms.
    You can easily get a very very good job here in the US sir.
    DS is the most important aspect for any Software Engineering interviews here.
    Anyways, thank you for the awesome work.
    I hope that your channel gets more famous.

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

    you did a great job seriously. i was stuck for 2nd case. and i found this video today.

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

    you are doing a great job. I appreciate you for explaining the correctness of the algorithm in the second case. I hope you keep explaining the correctness of all algorithms, if possible. And thanks a lot for creating such a great video in this topic.

  • @ramakantasamal7482
    @ramakantasamal7482 7 ปีที่แล้ว

    Can't believe how can someone explain a algorithm in such a simple way... You are the best I have seen so far on youtube for algorithms. you explain things in such a simple language that a 5 year kid can code :D.

  • @Msd-bk7yc
    @Msd-bk7yc 4 ปีที่แล้ว +1

    salute to teachers like you .Student need this kind of teachers

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

    Tutorial is useful.But if you discuss about the time and space complexities,it'll be very useful. Thanks:)

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

    it was a difficult topic to explain ..in general trees is difficult to teach ... thanks for explaining it well.

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

    your teaching is awesomer sir....#respect

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

    Such a Great Explanation...

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

    Thank you Vivekanand. You helped me again!

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

    Excellant teaching ....

  • @saharrohani5136
    @saharrohani5136 5 ปีที่แล้ว +2

    You made my life easy. Thank you so much.

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

      Hey even i do coding , but im stuck in this algo , if you're willing to help please reply back

  • @IMRANKHAN-zb3rw
    @IMRANKHAN-zb3rw 3 ปีที่แล้ว +1

    Great Explaination !!

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

    Your channels underrated

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

    Very nice explanation......

  • @021beats8
    @021beats8 4 ปีที่แล้ว

    You make my life so easy🙂

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

    great explanation

  • @ANANDJULU
    @ANANDJULU 5 ปีที่แล้ว

    Very nice explanation.. thank you.

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

    Sir u are great👍🏾

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

    I think it would be great if you had a board or something where you wrote the complete algo. Looking back I see the bottom right of your white board is very close to the solution of my problem which is:
    function inOrderPredecessor(node, target) {
    var candidate = null;
    while (node) {
    if (node.val < target) {
    candidate = node.val;
    node = node.right;
    } else {
    node = node.left;
    }
    }
    console.log(candidate)
    return candidate;
    }

  • @Sudeshna-Pradhan-9331
    @Sudeshna-Pradhan-9331 4 ปีที่แล้ว

    Ohoohoooo what an amazing tutorial....

  • @maheshshirsat9075
    @maheshshirsat9075 5 ปีที่แล้ว

    👌👌👌video

  • @cl-nr2zm
    @cl-nr2zm 3 ปีที่แล้ว

    This is just amazing! Thanks!

  • @AK-fn7ro
    @AK-fn7ro 5 ปีที่แล้ว +1

    The only problem with the playlist is that i gave ti minimize every video to like these videos

  • @NS-ef5yu
    @NS-ef5yu 7 ปีที่แล้ว +3

    Could you please upload a video on how to find the maximum sum path of a binary tree?
    Here is the full question:
    Given a binary tree consisting of nodes with positive integer values, write a method that returns the maximum sum of data values obtained by traversing nodes along a path between any 2 nodes of the tree. The path must originate and terminate at 2 different nodes of the tree, and the maximum sum is obtained by summing all the data values of the nodes traversed along this path.

  • @amitfritz11
    @amitfritz11 6 ปีที่แล้ว

    Nice explanation!

  • @sachinrknv
    @sachinrknv 6 ปีที่แล้ว

    Hi Vivekanand, Can you make video on convert binary tree to binary search tree.

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

    if you know how to find closest smaller node in BST, you can write it in 5 lines

  • @xiangwingrace8672
    @xiangwingrace8672 6 ปีที่แล้ว

    You are awesome!!! Great Video!! Thanks!

  • @arghyamitra3281
    @arghyamitra3281 7 ปีที่แล้ว +2

    Sir ur awsm

  • @jithinjp4420
    @jithinjp4420 5 ปีที่แล้ว

    beautiful, thank u sir

  • @samk8826
    @samk8826 7 ปีที่แล้ว

    Can you please add
    Given a binary tree, count the number of uni-value subtrees.
    A Uni-value subtree means all nodes of the subtree have the same value.

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

      in a binary search tree there cant be more than one of the same element i think

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

    What happens if the key is not present?

  • @Mei-ir3ml
    @Mei-ir3ml 7 ปีที่แล้ว

    Superb!!!!!

  • @sirigiris5062
    @sirigiris5062 7 ปีที่แล้ว

    Hi Sir,
    will you please give numbers to all videos then it is more easy to under standard .

  • @dadubharati5121
    @dadubharati5121 6 ปีที่แล้ว

    please do a video on red-black binary tree

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

    best vedios

  • @rahulkhandelwal46578
    @rahulkhandelwal46578 6 ปีที่แล้ว

    Thank you, sir .

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

    Written this code from the video. It's ok. but giving error for the leftmost element(the first element in inorder traversal).
    static void getInorderPredecessor(Node root, Node search) {
    if (root == null) {
    return;
    }
    if (search.left != null) {
    Node temp = search.left;
    while (temp.right != null) {
    temp = temp.right;
    }
    System.out.print(temp.key + " is the predecessor");
    } else {
    Node store = null;
    while (search.key != root.key) {
    if (search.key > root.key) {
    store = root;
    root = root.right;
    } else {
    root = root.left;
    }
    }
    System.out.print(store.key + " is the predecessor");
    }
    }

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

    thankyou!😃

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

    Thx!

  • @HarshKumar-nh6be
    @HarshKumar-nh6be 4 ปีที่แล้ว +1

    YOUR FAN FAN FAN FAN !!

  • @pixmen9433
    @pixmen9433 5 ปีที่แล้ว

    awesome video sir!! but shorten the content because mostly people see video to cover up quickly

  • @tamnuaysak
    @tamnuaysak 5 ปีที่แล้ว

    awesome

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

    thanks a lot

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

    The second case is not true for my example tree if you can share ur mail id I can send the example

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

    thanx

  • @umeshpal2758
    @umeshpal2758 5 ปีที่แล้ว

    Thank

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

    thank you for this vedio