Implementation of various algorithms technique in Java