...but...? A man has a goat, a lion and some grass. Now the man has to cross the river with the availibility of one boat only which can carry only two people/thing at a time. Now the problem is that if the man takes the grass first then behind him the lion will eat the goat or if he takes the lion first then the goat will eat the grass......HOW CAN THE MAN TAKE ALL THREE OF THEM SAFELY ACROSS THE RIVER? But I need the algorithm