algorithm practice and exercise