Making videos that attempt to explain with a lot of clarity algorithms and data structures, right now primarily about binary trees and binary search trees.
Yo, your video is amazing. Like I couldn't move on without visualizing what you shared in this video. Thanks and I am looking forward to equivalent content in other parts of DSA.
Hello, thank you for the video, I was wondering if it were possible to make the function int instead of Node* and just return root->key instead of root ? thank you
Hi, glad you liked it! The point of the function is to return the pointer to the node with a given key (or nullptr if there's no such node), so you actually already know what the key is. The problem with returning the key is that it does not seem useful and it is not clear what should be returned if the key is not in the tree. If what you want is to just know whether the key is present in the tree, you can return a bool instead of Node *.
Yo this video was so detailed and well explained. Looked so long for a video that covers the algorithm extensively, and you do an amazing job! Thanks a ton.
Hey! Thank you so much for making these vids man! I love how u use drawings to help visualize things. Don't worry about your subs or views, just keep putting out content, it'll all be of use one day.
Using the algorithm described in this video, the time complexity is O(n) (as mention at the end). This is the same no matter what the shape of the binary tree is. Therefore, the time complexity for a balanced binary search tree is still O(n).