Pregunta de entrevista de Apple

Design an algorithm to find the maximum sum of non-adjacent elements in an array.