Solve the following problems in Haskell.
Write a data type IntX
that represents an
integer, positive infinity, or negative infinity. Write functions
less
and greater
on this type.
Generalize IntX
to work with any appropriate
base type, not just integers.
Write a function isSearchTree
that determines whether
a binary tree is a valid binary search tree.
Assume that duplicate values are not allowed in the tree.
Write a function that takes a binary search tree and returns a list of all its values in order. Your function should run in time O(N), where N is the number of nodes in the tree.