some practise on basic algorithms with java