I'm not the last or the first to say that you're a great teacher. Thanks
@LucidProgramming5 жыл бұрын
I really appreciate that, Raisa. That means a lot! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support, and if you want to support the channel, I do have a PayPal link paypal.me/VincentRusso1 for donations that go directly to the creation of content on this channel. I hope that the content I provide there will enhance the videos on my KZbin page. bit.ly/lp_email
@rumanaislam475811 ай бұрын
Your explanation was really amazing, you should come back make more of this awesome videos. I was confused all day about how to define the bst functions and magically youtube suggested your channel.
@LucidProgramming11 ай бұрын
That's wonderful to hear. I would love to make a comeback, but time as of now is the limiting factor. Thank you in any case for the kind words!
@rumanaislam475811 ай бұрын
@LucidProgramming Please do, teachers like you are very rare these days!
@ahmedkidwai-4 жыл бұрын
Hi! I've taken data structure classes before (in java) and needed a refresher for Trees and in python. Your video series has been fantastic. Theory has been excellent and the code has been clean. Most tutorials I've seen have grouped the Node and BST classes together and I really didn't like that. I'm glad you split them up! Thank you for your amazing contributions.
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@khavishbhundoo37926 жыл бұрын
My takeaway on BST based on your awesome explanation: 1.BST is very good for searching , deletion and insertion provided the tree is balanced(log n).The selection of the root node will determine how balanced the tree will be.AVL or Splay tree will ensure the tree remain balanced. 2.If tree isn't balanced we essentially have a long list , making the time complexity O(n) 3.I noticed that if you apply Inorder traversal to a BST you get the nodes in ascending order.So if we want to sort with a tree it will O(nlogn) because building the tree is O(n)
@LucidProgramming6 жыл бұрын
Hi Khavish. That's an excellent summary of the video. I hope to find the time to cover AVL and Splay trees in upcoming videos :). Thanks for noting those key points, and of course, thank you again for watching and commenting as well. Cheers! :)
@khavishbhundoo37926 жыл бұрын
In this video BST is ordered in a way where left child < root < right child but i suppose that just a variant of BST. A variant where right child < root < left child could exist , an inverse of the ordering in other words
@LucidProgramming6 жыл бұрын
Hi Khavish. Absolutely. As long as the ordering that you impose on the tree is consistent, the overarching structure of a BST should be applicable to that. I'm struggling to think of any specific case in which this ordering would be beneficial to a problem, but perhaps I just haven't thought about it enough. Thanks again for your comment!
@khavishbhundoo37926 жыл бұрын
Same here ...although i did found a question on leetcode.com/problems/invert-binary-tree/description/
@LucidProgramming6 жыл бұрын
Ah, I see. Yes, once you have a regularly sorted binary search tree and want to invert that's a bit trickier than just constructing an inverse binary search tree from scratch. That Twitter quote is interesting. I recall hearing about that scenario where Google decided to not hire a candidate based on their inability to invert a BST, despite the fact that he had written software that was so widely used by the company. Thanks again for sharing the link!
@milkiasyeheyis54074 жыл бұрын
I can't believe this channel has only 30k subs. Really amazing content. Thank you for this.
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@rohanchakraborty42846 жыл бұрын
The way u teach in the video is truly impeccable..For me, ur videos are one of the best..,The concepts get clear..
@LucidProgramming6 жыл бұрын
Thank you kindly, Rohan that's very flattering. I appreciate your feedback, and thanks again for your comment! Cheers :)
@annidamf5 жыл бұрын
OMMMGGGG MY REAL MVP❤️❤️❤️❤️❤️❤️ THANKS A LOT SIR PLS KEEP MAKING VIDEOS LIKE THESE THEY HELP ME LEARN AND SURVIVE IN COLLEGE😭😭😭😭😭😭😭❤️❤️❤️❤️❤️ MUCH LOVE
@LucidProgramming5 жыл бұрын
Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support, and if you want to support the channel, I do have a PayPal link paypal.me/VincentRusso1 for donations that go directly to the creation of content on this channel. I hope that the content I provide there will enhance the videos on my KZbin page. bit.ly/lp_email
@shrikantpande94744 жыл бұрын
Thanks man.. you have no idea how much your videos have helped me.
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. I hope to be putting out more similar videos soon!
@muggie_guava2 жыл бұрын
Oh my god I finally understood how to implement the bst in python, thanks alot! Great video!
@LucidProgramming2 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@dhashdev3 жыл бұрын
Your explanation is amazing! Especially for the part which requires a lot of focus, I was able to understand in one go. Thank you, Please keep making content like this.
@LucidProgramming3 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@rahls75 жыл бұрын
This awesome playlist deserves a video on remove method for BST and finally avl trees and heaps :D
@LucidProgramming5 жыл бұрын
Thank you, Rahul! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support. I hope that the content I provide there will enhance the videos on my KZbin page. bit.ly/lp_email I hope to continue covering others topics like AVL trees and heaps in future videos!
@neurochannels5 жыл бұрын
Remove method would be nice that is a lot harder than add!
@NikhilParekh74 жыл бұрын
It would be really helpful if you can continue this series.
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@harshavardhanachary38634 жыл бұрын
you taught the code in an easy manner....I like it.......thank you so much sir.
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@peregudovoleg4 жыл бұрын
I was stuck with trees at some other course, but your code and explanations are very intuitive and make a lot of sense. Subscribed and thanks!
@LucidProgramming4 жыл бұрын
Cool, thanks for the support! I sincerely appreciate it!
@marinboras50014 жыл бұрын
Thanks a lot for making these videos. Python will be even easier to learn with such a great teacher!
@LucidProgramming3 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@marinboras50013 жыл бұрын
Already did that, keep up the great work! CS students are very lucky to have you!
@LucidProgramming3 жыл бұрын
@@marinboras5001 Cheers, I really appreciate the kind words!
@mrinmayigavali20495 жыл бұрын
I am so glad I found your videos. I watched all the videos in the Data Structures playlist of yours. I referred many books and videos but none of them have such a clear explanation of concepts as yours. Could you please make videos on Graphs as well? :)
@LucidProgramming5 жыл бұрын
That's really fantastic to hear, thank you so much! Graphs are most definitely on my shortlist. Thanks again for your comment and suggestion!
@gokusaiyan11282 жыл бұрын
@@LucidProgramming Graphs please !!!
@bijayamanandhar38902 жыл бұрын
Thank you for such a nice and clear presentation,
@LucidProgramming2 жыл бұрын
Of course, thank you for watching!
@JoseHernandez-ed5lz4 жыл бұрын
Incredible! Absolutely incredible! Thank you so much for your content! This is golden content!
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@kruthikhm63794 жыл бұрын
You are a different and great teacher
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@George-129726 күн бұрын
More than amazing explanation
@misatran11073 ай бұрын
Thank you very much. Very clear lecture and explaination
@davidrowlands85482 жыл бұрын
Yet another excellent video. Thank you
@carolynbose68024 жыл бұрын
thank you soo much Sir. All your videos have helped me a lot.
@LucidProgramming4 жыл бұрын
Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support, and if you want to support the channel, I do have a PayPal link paypal.me/VincentRusso1 for donations that go directly to the creation of content on this channel. I hope that the content I provide there will enhance the videos on my KZbin page. bit.ly/lp_email
@Yogi-hz2rd3 жыл бұрын
Very useful and informative Thanks alot!!!!
@LucidProgramming3 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@namanvohra82622 жыл бұрын
You just got a new subscriber
@LucidProgramming2 жыл бұрын
Much appreciated, thank you!
@rohanchakraborty42846 жыл бұрын
Please make a video on hashing and hash table stuffs...
@LucidProgramming6 жыл бұрын
Hi Rohan. That is most definitely on my "to-do list". I will hopefully get to hash tables sooner rather than later. Thanks for the suggestions! :)
@albertulysses4 жыл бұрын
Any update on hash tables?
@iashishhere4 жыл бұрын
@@LucidProgramming Any update sir?
@LucidProgramming4 жыл бұрын
@@iashishhere You can feel free to make suggestions on my Patreon page. This would streamline what you want to see and also help to support my channel. www.patreon.com/lucidprogramming
@Mickeyfsc26013 жыл бұрын
thanks so much your videos are really awesome and helpful
@LucidProgramming3 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@piratevv4 жыл бұрын
excellent teaching vincent!!
@LucidProgramming4 жыл бұрын
Thank you, very much appreciated!
@IshuGoelIshIshIsh92034 жыл бұрын
This is one of the best explained videos on Trees! Good job and thanks for the lucid explanation :) If I were to print the tree output as an image, how could I do that?
@LucidProgramming4 жыл бұрын
Thanks! As per your question, there are a number of ways you could do that. It really depends on how you want to display the tree!
@balamurugans3633 жыл бұрын
You are the best Boss ,Thanks
@LucidProgramming3 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@kamaboko15 жыл бұрын
Exceptional tutorial.
@LucidProgramming5 жыл бұрын
Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel. I hope that the content I provide there will enhance the videos on my KZbin page. bit.ly/lp_email
@siddhantbhardwaj42683 жыл бұрын
Can you do a video on AVL Trees, Red-Black Trees and N-Ary Trees ? Your lectures are golden.
@LucidProgramming3 жыл бұрын
Thanks! My time has been pretty sparse lately, but those are on my list. Cheers!
@estudosapenas77172 жыл бұрын
a function calling itself inside its own structure is still something that my brain can not comprehend
@LucidProgramming2 жыл бұрын
It is indeed a bit mind-boggling at first. I do have a playlist on recursion that you might want to check out to fill in some of those gaps. Cheers! kzbin.info/www/bejne/mp2meJZvZ9l0p9E
@leohangrai72984 жыл бұрын
Thank you so much! This is really brilliant and helpful. :')
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@Mohit-nn9bt5 жыл бұрын
Sir,it would be really helpful if u can go for advance topics like graph,avl tree,red-black tree,hash tables and more questions on tree
@LucidProgramming5 жыл бұрын
Those are on my to-do list. Stay tuned!
@Mohit-nn9bt5 жыл бұрын
@@LucidProgramming Sir People are asking for advance data structures tutorial from months.please try to update asap.Thanks
@LucidProgramming5 жыл бұрын
@@Mohit-nn9bt I understand. My recording setup was compromised due to a fire that occurred. I'm still trying to get back up and running. I appreciate your understanding and patience.
@jasoncole32535 жыл бұрын
@MOHIT KUMAR You can make a donation of 10$ to suggest for a video, he will definitely appreciate it www.patreon.com/join/lucidprogramming
@KKinHD104 жыл бұрын
Adding (' / ') or (' \ ') in the _find function would print path like structure with the direction of slash representing left child or right child : ) Pretty good to visualize the path to the node you searched for. if data < cur_node.data and cur_node.left: print(str(cur_node.data)) print(' / ') return self._find(data,cur_node.left) elif data > cur_node.data and cur_node.right: print(str(cur_node.data)) print(' \ ') return self._find(data,cur_node.right) ###### EXAMPLE OUTPUT ##### > bt.find(200) 1 \ 100 \ 250 / True
@mastermind54214 жыл бұрын
god tier tutorial
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@debashishchakraborty79245 жыл бұрын
Just WOW.!... Please post videos on graphs. :)
@LucidProgramming5 жыл бұрын
It's on my to-do list! :)
@prakashranjanpatra35394 жыл бұрын
Thank you very much... 😊👍👍
@LucidProgramming4 жыл бұрын
Cheers, and thanks for watching!
@JollyAZ4 жыл бұрын
Great video thank you
@LucidProgramming3 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@weichengzhu66056 жыл бұрын
Hi Lucid, Thank you for your very nice tutorials! And for the slides of this series, could you share? Thanks
@LucidProgramming6 жыл бұрын
I've updated the description with a link to the slides. Thanks for the suggestion, and thanks for your kind comment! Cheers!
@anirvansen29414 жыл бұрын
Awesome as always :)
@LucidProgramming4 жыл бұрын
Thanks! :)
@khavishbhundoo37926 жыл бұрын
Just a quick update , i have coded BST operations iteratively including deletion + tree traversals @ repl.it/repls/InterestingHumiliatingWordprocessing . @LucidProgramming Let me know what you think and any potential bug / optimization that i may have missed. Regards
@LucidProgramming6 жыл бұрын
Hi Khavish. I don't currently have the bandwidth to look at the code, but I'm happy to hear you've got it working. I recommend you look at how to test your code and run it on a number of edge cases to give you more confidence that your code is correct. Cheers.
@mateuszsmendowski26775 жыл бұрын
Can I have a question? Is there any vital difference between: 1. class Node(object): 2. class Node:
@LucidProgramming5 жыл бұрын
No, they are equivalent.
@aditya49744 жыл бұрын
Thanks again! Could you please cover AVL trees in your upcoming videos?
@LucidProgramming4 жыл бұрын
Thanks! No plans at the moment, but I would like to if I have the time!
@sutingyang94395 жыл бұрын
Could you please make some video on Machine Learning?
@LucidProgramming5 жыл бұрын
Absolutely, I actually have a series on machine learning that you can find here: bit.ly/lp_mlearn Cheers!
@jagdishwarbiradar17635 жыл бұрын
way you teaches is auesome , can you make any recursion video that covers the all concept of recursion , be-cause that confuses me a lots of time .
@LucidProgramming5 жыл бұрын
I've got you covered. I have a playlist on recursion you might find useful here: bitly.com/lp_recursion Cheers!
@anshumangupta28424 жыл бұрын
Please make a series on graph
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@heidik17574 жыл бұрын
Hello again :) Just wondering... to learn all of these algorithms frontwards, backwards and sideways. How long do you think it should take? (All of these data structures shown in all 40 videos). Really curious, thank you!
@LucidProgramming3 жыл бұрын
It really depends on your goals and scope. If you plan on using this information to say, pursue a PhD in data structures, my answer is going to be different than say, getting enough information to perform well at a technical interview. I offer tutoring and consulting, so if you have a specific goal in mind, you can reach out to the email in the "about" section to schedule in some time to set something up. Hope that makes sense. Cheers!
@heidik17573 жыл бұрын
thanks for the info! and I was wondering more for a more PhD level of understanding of data structures.
@LucidProgramming3 жыл бұрын
@@heidik1757 Gotcha. In that case, I would check out the CLRS textbook along with the "red" "Algorithm Design Manual". Those are two great books I would recommend, mostly as a reference, but also to read through. There are great companion courses for each of those books as well that you can find on KZbin. Hope that provides a reasonable start for ya, and don't hesitate to keep asking questions!
@amalmathew20304 жыл бұрын
thanks
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@prasanjithpatel94904 жыл бұрын
great code !!!!
@LucidProgramming4 жыл бұрын
Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!
@khavishbhundoo37926 жыл бұрын
What about duplicates in a BST ? Ofcourse we could just add an instance variable count in the node and be done with it.
@LucidProgramming6 жыл бұрын
Hi Khavish. From most of the definitions I've found, a BST typically will not allow the storing of duplicates. Your solution is probably one valid one, where if you want to insert a node with a data value that is already present, an auxiliary property of each node could be a count parameter that would increase if a duplicate value is inserted. Great point, Khavish. I really appreciate your commentary!
@rishikeshpuri61014 жыл бұрын
Sir, pls make video on graph algorithm, dynamic programming, greedy algorithm
@LucidProgramming4 жыл бұрын
It's on my to-do list!
@teutasalihu93643 жыл бұрын
How would you revise the find method to instead of returning T/F it returns the number of nodes that are examined
@LucidProgramming3 жыл бұрын
Have you tried doing this on your own?
@teutasalihu93643 жыл бұрын
@@LucidProgramming hi! yes, I’ve added a counter after every search to count the nodes but I don’t think I’m doing it correctly. Just wanted more insight on it :)
@gokusaiyan11282 жыл бұрын
I didn't wanted to use helper function so I did it this way. Though I am not sure if my code is pythonic or not. I still think in terms of C++ but below is my code. have a look class Node: def __init__(self, data=None): self.data = data self.left = None self.right = None class BinarySearchTree: def __init__(self): self.root = None def insert(self, root, data): if root is None: root = Node(data) elif data < root.data: root.left = self.insert(root.left, data) elif data > root.data: root.right = self.insert(root.right, data) else: print("value already present in the tree") return root def search(self, root, data): if root is None: return False elif root.data == data: return True elif data < root.data: return self.search(root.left, data) elif data > root.data: return self.search(root.right, data) def inorder(self, iter): """left->data->right""" if iter: self.inorder(iter.left) print(iter.data) self.inorder(iter.right) bst = BinarySearchTree() bst.root = bst.insert(bst.root, 10) bst.root = bst.insert(bst.root, 5) bst.root = bst.insert(bst.root, 20) bst.root = bst.insert(bst.root, 2) bst.root = bst.insert(bst.root, 2) bst.inorder(bst.root) print("1 in Tree : ", bst.search(bst.root, 1)) print("2 in Tree : ", bst.search(bst.root, 2))
@LucidProgramming2 жыл бұрын
Nice. Thanks for sharing!
@Samin75754 жыл бұрын
that saved me....
@LucidProgramming4 жыл бұрын
Glad to hear it! If you benefited, please drop a like and subscribe. Cheers!
@vishnurj62073 жыл бұрын
Please come back to youtube. And next time while making videos, please use the call stack to move through a recursive call function
@LucidProgramming3 жыл бұрын
When I get more time, I'll come back!
@davidrosen27053 жыл бұрын
hey great video, can you or anybody who knews explain at 17:25 when you cur_node.left = Node(data), i understnd that you want to assiagn value to the left node but why not cur_node.left = data, and why when i try to print(cur_node.left) after assignment it gives back thank you.
@LucidProgramming3 жыл бұрын
Because you need to print out the data at the left node: cur_node.left.data
@theguildedcage6 жыл бұрын
Noob question: Is 'object' passed in by default when creating these classes or is it omitted?
@LucidProgramming6 жыл бұрын
Hi Philip. I'm not sure I know what you mean. What do you mean when you say "object" in this case?
@theguildedcage6 жыл бұрын
LucidProgramming for example, what is the difference between these two classes. class Node(object): class Node:
@LucidProgramming6 жыл бұрын
@@theguildedcage Ah okay, that question is clearer to me. In Python 3, it makes no difference. Python 2 has a bit more a nuanced answer, but for 3, it doesn't make a difference. StackOverflow has some good information on this if you Google for it. Hope that helps. Cheers!
@enkaibi27565 жыл бұрын
Awesome video! A question on 22:14, why do you have to use Return instead of not using it. What is the difference? Without it, no syntax error, I just got a wrong result. It's killing me!
@LucidProgramming5 жыл бұрын
If you do not specify any return the default return is the "None" type. Hope that helps, and thanks again for watching!
@enkaibi27565 жыл бұрын
@@LucidProgramming Yeah! Gotta you! So glad that you replied! Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@LucidProgramming5 жыл бұрын
@@enkaibi2756 No problem!
@evanzhao38874 жыл бұрын
@@LucidProgramming if data > cur_node.value and cur_node.right: return self._find(data, cur_node.right) elif data < cur_node.value and cur_node.left: return self._find(data, cur_node.left) elif data == cur_node.value: return True else: return False I think if you change it into this way, that part will become a lot more easier to understand!
@LucidProgramming4 жыл бұрын
@@evanzhao3887 Cool, thanks for the suggestion!
@dhananjaywadhavane41064 жыл бұрын
what if two values are same in array for binary search tree?
@LucidProgramming4 жыл бұрын
That violates the definition of a binary search tree.
@Sagar_RS6 жыл бұрын
Hey I follow your videos for daily practicing , you are doing a great job. can you do other Data structures too in python ?. Thanks.
@LucidProgramming6 жыл бұрын
Hi Sagar. That's outstanding, I'm thrilled to hear that. Indeed, doing other data structure videos is on my list. I do intend to focus on that soon, and thanks again for your suggestion! Cheers, and thanks for watching.
@junaidiqbal23213 жыл бұрын
Sir what is self variable
@LucidProgramming3 жыл бұрын
I'm not going to be able to answer that in a KZbin comment. You should use Google.
@rukiliyanage84644 жыл бұрын
I was wondering if you can just do this: def insert(self, value) : if self.isEmpty() : self._root = self._Node(value) return parent = None probe = self._root while (probe != None) : if value
@LucidProgramming4 жыл бұрын
Have you tried this? The two insert functions are there because one is just a helper function.
@rukiliyanage84644 жыл бұрын
@@LucidProgramming yes i was wondering if using a helper function was more efficient than doing it all under one function?
@rukiliyanage84644 жыл бұрын
I was also wondering if you can just insert a whole list instead of just one integer at a time?
@LucidProgramming4 жыл бұрын
@@rukiliyanage8464 Efficiency has nothing to do with it, it's only for clarity.
@jaideepmore12995 жыл бұрын
def insertTree(self, item): if self.root is None: self.root = Node(item) else: self.insertHelper(self.root, item) def insertHelper(self, start, item): if start.data is None: start.data = Node(item) else: if start.data > item: self.insertHelper(start.data.left, item) else: self.insertHelper(start.data.right, item) getting error : TypeError: '>' not supported between instances of 'Node' and 'int' But, as i am using start.data then it shouldn't be giving this error. start is a Node object please help..
@LucidProgramming5 жыл бұрын
I would suggest you copy my code on the Github page. It's hard to diagnose as I don't see the rest of the code to know the type of what you're passing around here.
@jaideepmore12995 жыл бұрын
Umm is there any way in which I could share my code to you and you can take a look I ma curious to know what's wrong in my code. I can share my GitHub link if possible, Thanks for the reply .😀
@LucidProgramming5 жыл бұрын
@@jaideepmore1299 I don't really have the bandwidth to take that on at the moment. My suggestion would be to ask your question on StackOverflow and see if you can get some help there. Taking the time to phrase the question in a concise and simple way is helpful in finding a solution oftentimes.
@jaideepmore12995 жыл бұрын
No worries. Thanks
@khbye24114 жыл бұрын
23:14 I just learned that if none of the 3 branches in the _find function can be entered, then the function will return 'None'
@LucidProgramming4 жыл бұрын
Good to learn something new each day!
@vamsik31865 жыл бұрын
wow.....
@LucidProgramming5 жыл бұрын
Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel. I hope that the content I provide there will enhance the videos on my KZbin page. bit.ly/lp_email
@ahmedmohamed-yo2hb5 жыл бұрын
in search method i wanna return the node in which i found my value not only desplay the value and for that i wrote this but it returns None even if the node was found def search(self,val): if val==self.root.value: print('found') return self.root curr=self._search(val,self.root) if curr is not None: return curr def _search(self, node, current): if current.value < node: if current.right is None: print("not found") return elif current.right.value == node: print('found') return current.right elif current.right.value != node: self.root = self.root.right current = self.root self._search(node, current) elif current.value > node: if current.left is None: print("not found") return elif current.left.value == node: print('found') return current.left elif current.left.value != node: self.root = self.root.left current = self.root self._search(node, current)