Define
‘Big O’ notation
A notation that measures the efficiency of algorithms by notating the relationship between the number of operations (O) and number of elements in a set (n).
List
Types of search algorithms
Recall
The time complexity of a linear search.
O(n).
Recall
Steps of a Linear Search
Iterate over a set at a linear rate until the target is found.
Recall
The time complexity of a binary search.
O[log(n)].
Recall
Steps of a binary search
(The set MUST BE SORTED.)
List
Types of Sorting Algorithms
(BIS)
Recall
The time complexity for every sorting algorithm covered.
O(n^2)
Which sorting algorithm has a time complexity of O[n * log(n)]?
(Extension)
quicksort.
List
The steps of a bubble sort.
arr)), comparing each value (arr[i]) by its succeeding value (arr[i+1]) and swapping them if arr[i] > arr[i+1].List
The steps of a selection sort.
Instantiate a ‘sorted’ and ‘unsorted’ set, storing the ‘unsorted’ data in the ‘unsorted’ set, and leaving the ‘sorted’ array empty.
(‘pop’ — fetch value and then remove from set)
List
The steps of an insertion sort.
Instantiate a ‘sorted’ and ‘unsorted’ set, storing the ‘unsorted’ data in the ‘unsorted’ set, and leaving the ‘sorted’ array empty.
(like a selection sort-bubble sort hybrid)