Fundamentals of algorithms - AQAEfficiency of algorithms

Algorithms are step-by-step plans for solving problems. They can be designed using pseudo-code and flowcharts.

Part ofComputer ScienceComputational thinking and problem solving

Efficiency of algorithms

Not all are made equal, so it's a computer scientist’s job to consider the patterns and features to find the best solutions to problems.

For example, sorting data into alphabetical order could be completed using a number of different methods. The programmer could choose to use or , which are both standard sorting algorithms - but before choosing, it would be important to know which would be most efficient. You can read more about sorting algorithms in the searching and sorting algorithms guide.

Comparing the efficiency of algorithms

Efficiency looks at how much time it takes to run a particular algorithm and how much storage space is needed. By using both measurements, an algorithm that looks much more complex can actually be more efficient.

In the example of sorting data, the programmer might choose to look for the smallest piece of data and put that at the start of a new , then repeat the process until all the data has been removed from the original array. This would certainly solve the problem, but there are better ways to reach the goal. These would be described as being more efficient.