Assignment 1

Question:
A captain with his son, a dragon and a bag of candy needs to cross a river. The captian has a row boat but there is room for the captain himself and one of his three item. Unfortunately both the dragon and the son are hungry. The dragon cannot be left alone with the son, else the dragon will eat his son. His son cannot be left alone with the candies, else he will eat the candien. How does the captain get everything across the river.




boy
Solution:
  1. Take his son to the far shore
  2. Return
  3. Take the candies to the far shore
  4. Return with his son to the near shore
  5. Take the dragon to the far shore
  6. Return
  7. Take his son to the far shore