Top-Down Splay Tree Java implementation
Java
Switch branches/tags
Nothing to show
Latest commit 0f083da Sep 30, 2011 Pedro Oliveira Updated header message

README.md

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);
}