Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Binary Tree Part 2 | BST | Binary Search Tree – Data Structures & Algorithms Tutorials In Python #11

104.4K views on YouTube

In this part 2 tutorial of binary tree, binary search tree (a.k.a BST), we will see how you can delete a node from a binary search tree. We will look at 3 different cases where a node you are deleting is a leaf node, or it has only one child or it has two children. We can handle deletion in different ways in these cases. We will implement node deletion in python and in the end there will be an exercise that you can practice your skills on.

Exercise: https://github.com/codebasics/data-structures-algorithms-python/tree/master/data_structures/9_Binary_Tree_2/9_binary_tree_part_2_exercise.md
Code of this video: https://github.com/codebasics/data-structures-algorithms-python/tree/master/data_structures/9_Binary_Tree_2/binary_tree_part_2.py

Topics:
00:00 Introduction
00:21 Theory behind node deletion
04:13 Python code for node deletion
14:21 Exercise

#datastructures #algorithms #python

Do you want to learn technology from me? Check https://resources.codebasics.io/pPM7bO for my affordable video courses.

Next Video: https://www.youtube.com/watch?v=j0IYCyBdzfA&list=PLeo1K3hjS3uu_n_a__MI_KktGTLYopZ12&index=12
Previous video: https://www.youtube.com/watch?v=lFq5mYUWEBk&list=PLeo1K3hjS3uu_n_a__MI_KktGTLYopZ12&index=10
Complete playlist:https://www.youtube.com/playlist?list=PLeo1K3hjS3uu_n_a__MI_KktGTLYopZ12

Website: https://resources.codebasics.io/pPM7bO
Facebook: https://www.facebook.com/codebasicshub
Twitter: https://twitter.com/codebasicshub