CustomFurnish interview question

Tree to Linkedlist problem in python