Balanced search trees
Write a module BalancedSearchTree that implements balanced binary search trees. Use the name "BStree a" to denote the datatype. Your implementation should support the following functions.
find :: (BStree a) -> a -> Bool
-- Reports whether the given value is found in the tree
insert :: (BStree a) -> a -> (BStree a)
-- Inserts a value into the tree, maintaining logarithmic
-- height
delete :: (BStree a) -> a -> (BStree a)
-- Deletes a value from the tree, maintaining logarithmic
-- height
height :: (BStree a) -> Int
-- Returns the height of the tree
size :: (BStree a) -> Init
-- Returns the number of nodes in the tree
isemptytree :: (BStree a) -> Bool
-- Tells whether the tree is empty
emptytree :: (BStree a)
-- Returns an empty tree
buildtree :: [a] -> (BStree a)
-- Build a search tree in linear time from a sorted list
listtree :: (BStree a) -> [a]
-- List out the values in the tree in ascending order, in
-- linear time