An algorithm is just a set of instructions to solve a problem

2 years ago
13.7K

To solve this particular problem,we've introduced in line 4 a condition,otherwise known as a branch,that only executes if there is one person we could not pair with another.So now, whether there's 1 or 3or any odd number of people in the room,this algorithm will now count them.Can we do even better?Well, we could count in 3's or 4's or even 5's and 10's,but beyond that it's going to get a little bit difficult to point.At the end of the day,whether executed by computers or humans,algorithms are just a set of instructions with which to solve problems.These were just three.What problem would you solve with an algorithm?

Loading comments...