tests both algorithms for a list of test inputs