Block interview question

Convert a tree to a list