Assignment 4
- Define in Scheme the following functions on lists.
- (min_max lst): Return a pair (min max) where min is the minimum element and max is the maximum element of the list lst.
- (insert_sort lst): Return a sorted list of lst, using the insertion sort algorithm.
- Define in Scheme the following functions on binary trees. A binary tree is represented as a list of three elements (value left right), where left is the left subtree and right is the right subtree. An empty tree is represented as ().
- (count tree): Return the number of nodes in tree.
- (in_order tree): Return the in-order traversal of tree.
- (leaves tree): Return the leaves in the tree from left to right.
- Textbook 10.7 (page 553)
- Textbook 10.9 (page 554)