Some interesting algorithms implemented in java