Explain
‘Big O’ complexity chart
A graph that shows the efficiency of algorithms by plotting the number of operations required to sort a given number of elements in the worst-case scenario (i.e. the target number is the last number to be found)
it shows how performance scales with input size
Explain
‘Big O’ notation
(time complexity)
A measure of how fast an algorithm runs based on the size of its input.
O(n) means algorithm speed grows at the same rate as its input size.
Recall
The two search algorithms.
LB
Explain
What occurs in the linear search algorithm?
An array is iterated through in index order until the target is found.
Explain
What occurs in the binary search algorithm?
halves sort
repeats and halves search area until target is found
note that binary search requires the array to be sorted.
Recall
The three sort algorithms.
BIS
Explain
What occurs in the bubble sort algorithm?
Repeats in passes over the whole array until everything is swapped correctly.
Explain
What occurs in the insertion sort algorithm?
no clue bro
Explain
What occurs in the selection sort algorithm?
Repeats in passes over the whole array until everything is swapped correctly.
Recall
All sorting algorithms (that we’re required to know) have a time complexity of?
O(n²)
(this is not good, and gets geometrically slower as #elements increases)
Recall
What is the time complexity of the binary search algorithm?
O[log(n)]
(this is very good, but it requires the data to be sorted first.)
Recall
What is the time complexity of the linear search algorithm?
O(n) ☹️
this is okay but not ideal and gets slower with larger databases