Skip to content

BST: Insert an equal value in right subtree - #4

Open
darionhaase wants to merge 1 commit into
cryingshadow:mainfrom
darionhaase:rwth-dsal-bst-insertion
Open

BST: Insert an equal value in right subtree#4
darionhaase wants to merge 1 commit into
cryingshadow:mainfrom
darionhaase:rwth-dsal-bst-insertion

Conversation

@darionhaase

Copy link
Copy Markdown

Greetings from Aachen,

we link to a web version of this tool for our students of the data structures and algorithms lecture so they can generate more exercises on their own.
Unfortunately, the algorithm for insertion into binary search trees differs from the one we present in the lecture. If the value to insert is the same as the one in the root, we insert it into the right subtree. The current implementation inserts into the left subtree.

While it does not matter for a BST, it can cause deviations in the required rotations for AVL trees. As I do not know what your implementation's literature reference is, maybe you want to adapt to our lecture's behaviour with this PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant