algorithm exercises