a basic representation of the classic algorithms in Java