Define a Scheme procedure, named tree-sort, which takes a list of numbers and outputs the same list, but in sorted order. Your procedure should sort the list by:
(a) inserting the numbers into a binary search tree and, then,
(b) extracting from the binary search tree a list of the elements in sorted order.
To get started, write a procedure called insert-list which takes a list of numbers L and a tree T, and returns the tree that results by inserting all numbers from L into T.
Then write a function called sort-extract which takes a binary search tree and outputs the elements of the tree in sorted order. (We did this in class!)
Then, finally, put these two functions together to achieve tree-sort.