Justin Wetherell's Algorithms on https://code.google.com/p/java-algorithms-implementation/