Amazon Interview Question

Sort the binary tree. Create a priority queue using heap