Pregunta de entrevista de Amazon

Tree-structure and optimization-based algorithm questions.