Binary Search Trees - Find Smallest Key Function - C++ - Part 9

Поділитися
Вставка
  • Опубліковано 2 жов 2024

КОМЕНТАРІ • 9

  • @DigiMan1031
    @DigiMan1031 4 роки тому +3

    I feel like I actually learned more here than in my DS class in college, no all heroes wear capes

  • @codingandmathvideos
    @codingandmathvideos 10 років тому +3

    excellent!!! Can you also create an AVL tree project? How to insert, remove, and rotate while keeping the tree balanced?

  • @mef526
    @mef526 10 років тому +1

    You can improve the code by eliminating the "else" clauses that follow if's with function return

    • @Katatonya
      @Katatonya 4 роки тому

      what do you replace them with?

  • @Bolloxologeeee
    @Bolloxologeeee 10 років тому

    yet another great video.cheers man!

  • @djBC10000
    @djBC10000 8 років тому

    this function wouldnt work for all cases
    think about this case.
    5 items all in increasing order , and the 2nd to last item has a left child.
    your code will check the first item which is the root (starting point)
    and see that its left child is NULL, then it returns the NULL value, which will seg fault

    • @davidhuynh2560
      @davidhuynh2560 8 років тому +1

      What are you talking about? The example you mention would return the root key

    • @djBC10000
      @djBC10000 8 років тому +3

      +David Huynh (Magic Man) never mind, my original post is actually wrong, so just ignore what I said, thanks