2.3.1 Analysis, Design & Comparison of Algorithms Flashcards
State two pieces of information used to analyse an algorithm.
Time complexity
Space complexity
What is meant by time complexity?
How much time an algorithm requires to solve a particular problem
How is time complexity measured?
Using big-o notation
What does big-o notation show?
The time taken relative to the number of data elements given as an input
How can big-o notation be used?
To predict the amount of time taken to solve an algorithm given the number of elements stored
What is the name given to O(1)?
Constant time complexity
What is the name given to O(n)?
Linear time complexity
What is the name given to O(n²)?
Polynomial time complexity
What is the name given to O(nⁿ)?
Polynomial time complexity
What is the name given to O(2ⁿ)?
Exponential time complexity
What is the name given to O(log n)?
Logarithmic time complexity
What is the name given to O(n log n)?
Linearithmic time complexity
Describe what is meant by O(1).
The amount of time taken to complete an algorithm is independent from the number of elements inputted
Describe what is meant by O(n).
The amount of time taken to complete an algorithm is directly proportional to the number of elements inputted
Describe what is meant by O(n²).
The amount of time taken to complete an algorithm is directly proportional to the square of the elements inputted