practice of some basic algorithms with java