Binary Search Trees (BST) Explained and Implemented in Java with Examples | Geekific

Поділитися
Вставка
  • Опубліковано 28 лип 2024
  • Support us on Patreon: / geekific
    Discord Community: / discord
    GitHub Repository: github.com/geekific-official/
    Following our introductory trees video, and as promised, today, we delve in binary search trees. In this video we start by explaining what binary search trees are, then go ahead and detail each operation offered by this type of trees, and finally we implement these operations using Java.
    Timestamps:
    00:00 Introduction
    00:22 What are Binary Search Trees?
    04:11 Inserting to and Deleting Items from the Tree
    06:27 Traversing a Binary Search Tree
    07:56 The BST Implementation
    09:34 Retrieve the Min and Max Elements
    11:01 Implementing the Traverse Operation
    12:46 Implementing the Insert Operation
    17:22 Implementing the Delete Operation
    19:47 Thanks for Watching!
    If you found this video helpful, check other Geekific uploads:
    - Graphs - The Fundamentals: • Introduction to Graphs...
    - Introduction to Trees, Basic Tree Terminology and Different Types of Trees: • Introduction to Trees ...
    - Generics and Wildcards in Java Made Simple: • Generics and Wildcards...
    - Time and Space Complexity Simplified: • Introduction to Big-O ...
    - Project Lombok Annotations Explained: • Project Lombok Annotat...
    - SOLID Principles and Best Practices: • SOLID Design Principle...
    - Recursion Made Simple, Recursive Methods: • What is Recursion? | R...
    - Use-Case and Sequence Diagrams: • UML Use-Case and Seque...
    - Generics and Wildcards in Java, Invariance vs Covariance vs Contravariance: • Generics and Wildcards...
    #Geekific #BST #BinarySearchTrees

КОМЕНТАРІ • 33

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

    It took me some time to understand the deletion of the node that has two children. But finally understood after watching again and again. Thank you very much. You are doing a great job and I'm a big fan of your channel.

  • @alooooshm
    @alooooshm 2 роки тому +7

    This is super great! It's truly fabolous how you compress all the heavy concepts in 20 minute video and still be as detailed and practical as a 3 hour university lecture. Pretty much respect keep it up🙏

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

      Thanks a lot :) Really glad I could help!!

  • @ioanacrisan3684
    @ioanacrisan3684 5 місяців тому

    Thank you for your work! Great graphics and nice explanations.

  • @o.s.1406
    @o.s.1406 8 місяців тому

    You are more helpful than my college professors. I would rather pay my tuition to you!

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

    Because of your way how you explain, you helped me to understand it very fast. Thank you

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

      You are welcome! Glad it helped :)

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

    Hey, Been watching your videos to understand basic data structures and algorithms. Just wanted to thank you for your expainations and using generics. You are a great help.

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

      Glad to help! That's what the channel is here for :)

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

    Saying again , its a underrated channel. while the videos like "A day in mang\fang" gets millions views , this gold content is not nowhere touching 10k views. Says a lot about people behaviour in general.

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

    The implementation of deep recursion is awesome !!!

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

      Glad you liked it :)

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

    This is a great video! Thank you!

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

      Glad you liked it!

  • @blake-hz5vx
    @blake-hz5vx Рік тому

    Great video very helpful

  • @ahmad-ali14
    @ahmad-ali14 Рік тому

    super helpful

  • @jiu89b68hso8
    @jiu89b68hso8 9 місяців тому

    Thank you!

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

    this video is sick you helped me so much thanks

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

      So glad it was helpful! :)

  • @sadiulhakim7814
    @sadiulhakim7814 11 місяців тому

    Nice Video

  • @chim8938
    @chim8938 7 місяців тому

    What about removing with a parent pointer?

  • @prashantrajgor03
    @prashantrajgor03 9 місяців тому

    This is really useful, just have one question, the code you provided for inserting node will work if there is a duplicate value?

    • @geekific
      @geekific  9 місяців тому

      Glad it was! Nope since we have comparison for greater and smaller only :) Cheers!

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

    In the delete implementation .. one child case .. how is the child is automatically assigned as a parent (in the return statement)?

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

      Yes! It works similarly to what was explained between 15:00 and 17:20

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

    Great for reducing the code by adding more methods. height (node) method has a condition if the node is null then it will return 0. My suggestion is return -1 instead of returning 0 then AVL balancing works perfectly. Any one Please let me if anything is wrong from my side.

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

      Hello! Am not sure I got you, but feel free to check our AVL video here: ua-cam.com/video/Jj9Mit24CWk/v-deo.html :)

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

    Mr. Takei?

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

    where is main testing code...

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

      Hey, I figured it was better to centralize everything in the same video :) Check it here: ua-cam.com/video/hmSFuM2Tglw/v-deo.html. Cheers!

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

    I could not understand the part of deleting a node having two children nodes. Pronunciation of the words threw me off

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

      Sorry about that! Feel free to ask any question and I'll try my best to clarify :)