-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To prevent the tree from becoming skewed, we applied a heuristic cal- led the 'max height splay' method. When the size of the tree is n, and its height exceeds 50*(log n), the deepest node is selected and splayed to the root. To avoid excessive balancing when the tree has few nodes, the balancing process is skipped if the number of nodes is 1000 or fewer. Since the 'max height splay' method requires knowledge of the tree's height, we added a height attribute to the nodes of the splay tree and included code to check the height during testing.
- Loading branch information
Showing
4 changed files
with
107 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters