YEAR 2 CO2 WEEK 5 ALGORITHM EFICIENCY Flashcards
How do you have to consider when deciding which algorithm is most suitable?
Space Efficiency.
Time Efficiency.
Big O Notation.
Explain what is meant by Space Efficiency?
A measure of how much memory (space) an algorithm takes as input (N) scales up.
Space taken up by code as N increases.
Taken up by data as N increases.
What is meant by Time Efficiency?
Measure of how much time it takes to complete an algorithm as input (N) increases.
How do programmers choose between time efficiency and space Efficiency?
They don’t! They have to decided in the situation.
If algorithm is time-critical then a fast algorithm is needed but there must be enough memory to handle it.
If there is a hardware limit to memory then a slower one needs to be used.
What is Big O?
It is used extensively to describe quality of algorithms.
There is a relationship between input N of algorithm and time or space takes to complete.