Write a function perms :: [a] -> [[a]]
that returns a list of all permutations of a given list. Do not
assume that the type a implements Eq.
Consider this definition of a binary tree:
data Tree a = Nil | Node (Tree a) a (Tree a)
Write a function is_search_tree that determines whether
a binary tree is a valid binary search tree:
is_search_tree :: Ord a => Tree a -> Bool
Assume that duplicate values are not allowed in the tree.
Write a function tree_foldr that
performs a right fold of a function over the values in a binary
tree:
tree_foldr :: (b -> a -> a) -> a -> Tree b -> a
Use tree_foldr to write
functions that
add all the values in a binary tree of numbers;
generate a list containing all the values in a binary tree