3.1.2 - Efficiency of algorithms Flashcards
(5 cards)
What is an efficient algorithm
An algorithm that solves a problem using the least amount of resources, such as time and space
Why is algorithm efficiency important
Performs tasks faster and using less resources, which is better for large algorithms and reduce costs.
How can two algorithms solving the same problem differ in efficiency?
One may use less storage or may be more time-efficient by using less steps
Example of two algorithms that solve the same problem but may have different efficiencies.
Linear search and binary search both solve the problem of finding an item in a list, but binary search is more efficient for sorted lists.
The efficiency of an algorithm is affected by:
Number of steps needed
Amount of memory or storage used
Type of algorithm used (e.g, linear or binary)