Introduction to Haskell | ||
---|---|---|
Prev |
If there's time left over try:
Write a function to sum a list of numbers.
Write a data structure to represent a phone book of your friends and enemies. Write functions with the type:
isEnemy :: Address -> Bool getEnemies :: [Address] -> [Address]
which tell you whether or not an address represents an enemy, and returns just your enemies respectively.
Implement a queue using two lists for efficiency. The queue should have operations similar to a stack.
Implement a tree of arbitrary bredth (not just a binary tree). Implement size and sum for this tree.