Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- breadthFirst
- breadthFirst :: Tree a -> [a]
- breadthFirst Empty = []
- breadthFirst t = hack [t]
- -- hack
- hack :: [Tree a] -> [a]
- hack [] = []
- hack ((Node a t1 t2):xs) = [a] ++ (hack (xs ++ [t1] ++ [t2]))
- hack ((Empty):xs) = hack xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement