Write a function to implement the tree sort algorithm of Exercise .
Exercise
A binary search tree can also be used to sort a list. We simply insert the list elements into a BST, initially empty, and then use an in order traversal to copy them back into the list. Write an algorithm for this tree sort method of sorting, assuming that the list is stored in
a. an array.
b. a linked list.