Skip to content

Conversation

@jonathanstallings
Copy link
Owner

No description provided.

jonathanstallings and others added 30 commits July 4, 2015 21:04
…jonathan

Fix queue references due to linked list refactor
jonathanstallings and others added 30 commits August 3, 2015 14:04
Simplify the bst left and right rotation methods

Remove the if block in the _rotate_right and _rotate_left methods from
bst.py that validate the parent node of the pivot, as well as the code
that updates the pivot's parent at the end of _rotate_right and
_rotate_left.

The pivot's parent does not change throughout the rotation of the tree.
Get rid of the lines that update the parent of the pivot node because
the parent of the pivot stays constant in _rotate_left and
_rotate_right. Lines 278, 279, 295, 296 can be deleted without altering
the functionality of the rotation algorithms and gets rid of the
unneeded code that updates the parent of the pivot node.

In addition, lines 283 and 300 also unnecessarily update the parent of
the pivot node. This can be removed without changing the functionality
of _rotate_left and _rotate_right.

The parent of the pivot node does not change in _rotate_right or
_rotate_left. Delete code that updates the parent of pivot.
Simplify bst.py rotation algorithms
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.

5 participants