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

preview_player
Показать описание
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.

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

#datastructures #algorithms #python

Рекомендации по теме
Комментарии
Автор

I have seen many videos, blogs, and sites, but this one is different, and I learned a lot. Thank you, sir.

BhanuPrakashVuppula
Автор

Your tutorial are really great man, I have gone through udemy but can't find better course than yours.

Plz I have a humble request, plz, plz continue this series on data structures

nsptech
Автор

In line 74, 75, if self.right is None then return self.left, isn't it.Thanks for making such wonderful and explanatory videos .

ashishsachdev
Автор

I guess there is some mistake here 9:20 line - 75
If self.right is None: return self.right ....it should be self.left, isn't it? As in the opposite case of line 73

omkarg
Автор

Really very happy about finding such an obvious and understood funny video series about data structures and algorithms. Everything is 100% clear with deeply explained theories and well-understood practicals. Also, the exercise series with the videos are highly appreciated. Dear sir thank you so much for the fantastic video series. ❤💖

tharindusathsara
Автор

THE BEST SERIES ! please continue uploading man, you're awesome

WeakCoder
Автор

Thank you very much for your great tutorials. They are highly informative, while being easy to follow along. Before finding out that there was a debugging of the delete method, I stopped the video and tried to understand why my code was not working. I found that really helpful in terms of understanding what the function actually does! Wanted to mention it, in case you'd like to use debugging as an exercise for your next videos.

berk
Автор

3:22 I'm very confused- I thought everything in the right subtree of the root node was supposed to be greater than the root node. If that's the case and the root node is 17, how is there a 13 in one of the subtrees to the right of the root node? Wouldn't that screw with in order traversal? If you deleted 20, 19, and 18, you'd end up with 17 still as the root and 13, 23, 34 in the right tree, right?

ironrose
Автор

@codebasics
i know that this channel focusses on data science, but you are simply awesome!..its a request, please try to add algorithms implemented in python also!!

pythonenthusiast
Автор

You saved my career! Respect for making such amazing videos and excercises. Thank you so much.

AnjaliPardeshi
Автор

Your tutorials are really great and helpful. Please continue this series

shreyapattewar
Автор

thank you veery much for the video.
i didnt understant the method at first time, but analyzed it and got understood.
Very good solution

exploringcrypto
Автор

Best tutorials for beginners. And best help for pros to revise.

art_ik
Автор

Hi, In the video at duration 10:11 there is a node with value 13 right subtree lesser value than root node value 17, Is this make BST?

hemant-brt
Автор

My favorite DSA playlist so far! Thanks:)

jeelgondaliya
Автор

Awesome tutorial thanks. I find your tutorials easy to follow and understand.

Could you please clarify something about the delete function if you ever read this comment?
1: For line 75, should this be self.left instead? (this seems it would be consistent with line 70)

2: If line 75 is indeed self.left, then line 77 seems impossible. Sorry, I can't seem to figure out what I'm missing

philndayisaba
Автор

Best series for knowing about DSA in python till date. Really appreciate your efforts. please make videos on machine learning

rajnishpandey
Автор

sir u r great, love u sir, i tell this from bottom of heart, may god almighty give long live u sir, to teach to future generation
Love u sir, Love from tamilNadu

jaheerkalanthar
Автор

For anyone wondering if it should be self.left in line 75 - you're right it should be self.left and not self.right. With the latter we won't even check if there is a left child and delete the current node. In this case deleting two(or multiple depending on where the val is located in the tree) nodes instead of one.

lokendrasinghsolanki
Автор

followed ur playlist till here, simple and easy to understand, love it :)

jiakai
welcome to shbcf.ru