Java implementations of algorithms