在Haskell中查找树是否为二叉搜索树
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 …