Oh no... 🤬 I forgot to buy bread and the guests are about to arrive soon.
Great! I brought the bread home! If we were to summarize this,
we would obtain the
sequence of actions required to buy bread:
beginning
take the necessary money;
go to the store;
find desired bread;
pay for it;
exit the store;
head home;
arrive home;
end.
We will call this final sequence of steps the
bread-buying algorithm.
Thus, anyone who buys bread will follow the actions outlined in this algorithm.
So, what exactly is an algorithm?
We can think of it as
a series of actions aimed at achieving a
specific goal. However,
providing a precise definition of an algorithm is challenging.
It is important to note that the
actions constituting an algorithm
must be executed in the
order they are listed. For example, there's no point in heading to buy bread if we haven't taken
the money, and we can't ask for bread if we haven't reached the store, etc.
Arrange the actions in the correct order.
Proceed to the next page of the section.