small program of algorithm learning