Step-by-step explanation:
Remember, an algorithm in simple words means a set of instructions or steps to be followed in other to solve a problem.
Note, to decide which commute is cheaper, it means the output of the algorithm should be the cheaper way to commute.
Using pseudocode do the following;
- determine the inputs and outputs of the problem
- arrange the identified problem into micro-tasks
- describe each micro-tasks in the pseudocode
- Test the pseudocode by solving the problem.