Big O notation Flashcards
time complexity
shows how much time it requires to solve a particular problem
what is time complexity measured using
Big O notation which shows the effectiveness of an algorithm
O(1)
**Constant time complexity **
the time taken to complete an algorithm is independant from the number of elements inputed
O(n)
linear time complexity- the time taken to complete an algorithm is directly proportional to the number of elements inputted
O(n^2)
polynomial time complexity- the time taken to complete an algorithm is directly proportionate to the square of elements inputted
O(2n)
**exponential time complexity ** - the amount of time taken to cmoplete an algorithm will double each time an item is added
O(log n)
**logarithmic time complexity ** - the time taken to complete an algorithm will increase at a smalelr rate as the number of elements is inputted
binary search time complexity is…
(o(log(n))
linear search time complexity is…
o(n)
bubble sort time complexity is
0(n^2)