Pregunta de entrevista de Splunk

BFS graph question and a greedy algorithm question.