We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Nice! Here is my more concise version. No need to check if r.left (or r.right) is None and then create a new Node if it is None. If it is None, then you can call the recursive function the new Node will be returned in the next layer of the recursion
Binary Search Tree : Insertion
You are viewing a single comment's thread. Return to all comments →
Nice! Here is my more concise version. No need to check if r.left (or r.right) is None and then create a new Node if it is None. If it is None, then you can call the recursive function the new Node will be returned in the next layer of the recursion