0% Completed

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

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

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/blob/master/data_structures/9_Binary_Tree_2/9_binary_tree_part_2_exercise.md

Code: https://github.com/codebasics/data-structures-algorithms-python/blob/master/data_structures/9_Binary_Tree_2/binary_tree_part_2.py