type BSTree a = BinaryTree a data BinaryTree a = Null | Node (BinaryTree a) a (BinaryTree a) deriving Show flattenTree :: BinaryTree a -> [a] flattenTree tree = case tree of Null -> [] Node left val right -> (flattenTree left) ++ [val] ++ (flattenTree right) isBSTree :: (Ord …