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.
Binary Search Tree : Insertion
Binary Search Tree : Insertion
Sort by
recency
|
579 Discussions
|
Please Login in order to post a comment
Java:
Doesn't seem to work properly in JavaScript.
I’ve been learning BST insertion to improve how my script executor handles commands. If you're into Roblox scripting, Delta Executor uses similar logic to run scripts smoothly — worth checking out for automation ideas.
My Java 8 Solution
if(root == null) { root = new Node(data); } else if(data < root.data) { root.left = insert(root.left, data); } else { root.right = insert(root.right, data); } return root;