Skip to content

cpdomina/SplayTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Splay Tree

Top-Down Splay Tree Java implementation. Splay Trees are self-adjusting binary search trees with the additional property that recently accessed elements are quickly retrieved.

Largely based on the implementation by Danny Sleator, available on public domain. Cleaned & refactored code, added generics, builders, iterator, and a couple of minor performance improvements.

Usage

SplayTree<Integer> t = SplayTree.create(1,0,2,4,3);

assert t.findMin() == 0;
assert t.findMax() == 4;
assert t.contains(2) == true;

t.insert(5);
t.remove(1);

for(int i: t) {
	System.out.println(i);
}

About

Top-Down Splay Tree Java implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages