exercises of algorithm