ALGORITHMS: LAB #5 Solution