Pregunta de entrevista de Bloomberg

Asked about how to make a binary tree into an array and then how to sort the array with binary search.