Consider the following constructor for binary trees in Scheme:

(define (make-bintree key value left right)
(define (get-key) key)
(define (get-value) value)
(define (get-left) left)
(define (get-right) right)
(define (set-left! tree) (set! left tree))
(define (set-right! tree) (set! right tree))
(define (set-value! v) (set! value v))
(define (dispatch m)
(cond ((eq? m 'k) get-key)
((eq? m 'v) get-value)
((eq? m 'l) get-left)
((eq? m 'r) get-right)
((eq? m 'sl!) set-left!)
((eq? m 'sr!) set-right!)
((eq? m 'sv!) set-value!)))
dispatch)
(define tet 'gloriosky) (define (empty-tree? t) (eq? t tet))

1. Write the selectors key, value, left, and right, each of which takes a binary tree as its input and return the key, value, left subtree, and right subtree, respectively.

2. Write these mutators:

(set-left! k v t) ; makes a node with k and v, then sets the left subtree of t to it.
(set-right! k v t) ; makes a node with k and v, then sets the right subtree of t to it.
(set-value! v t) ; changes the value of an existing node in the tree to v

3. Write (insert! k v bst) that finds the appropriate place to insert a key-value pair in a binary search tree based on the key and does so. If the key is already in the binary search tree, then change the value to v. Note that keys in binary search trees are unique.

4. Define bst to be (make-bintree 10 'cow tet tet). Then write code that creates the following binary tree:

                  bst --> (10, 'cow)
                         /          \
                        /            \
                 (4, 'fish)    (17, 'arugula)
                                  /
                                 /
                           (13, 'pepsi)

5. Write the function inorder that returns a list of all of the key-value pairs in a binary search tree. Use cons to present the data as pairs.

> (inorder t)
((4 . fish) (10 . cow) (13 . pepsi) (17 . arugula))