Implemented programming assignment 6 (algo-005)