Databricks interview question

Get an array in place from binary tree