data Tree a = Empty | Node a (Tree a) (Tree a) deriving Show

dfs :: Tree a -> [a]

dfs Empty = []
dfs (Node x lb rb) = x:(dfs lb)++(dfs rb)

bfs :: Tree a -> [a]

bfsns :: [Tree a] -> [a]

bfs = bfsns . return

bfsns [] = []
bfsns ts = (ts >>=
            (\t ->
              case t of
                Empty -> []
                Node x _ _ -> [x]))
           ++
           (bfsns $ ts >>= (\t ->
                             case t of
                               Empty -> []
                               Node _ lb rb -> [lb,rb]))

