Algorithms set 1