Big O: Make it Simple Determine how complex the algorithm is, in relative to the size of the problem (e.g: List to be sorted) 'O' Stands for 'Order' - E.g: This algorithm costs an 'order' of X to run The size of the problem In sorting list problem, the size of the problem is the length of the list The Big O expresses how complex is the algorithm in relative to the length of the list to be sorted. Usually, the length is replaced with 'N' E.g: O (Log N)
Bubble-Sort Example The number of operations needed to sort the Size = 5 Number of Operations = 24 The number of operations needed to sort the list with bubble-sort grows much faster than the size of the list!!
Big O: Make it Simple - If you double the size of the list; → The number of operations = = 4 - If you triple the size of the list; → The number of operations = = 9 So, the Big (O) notation becomes : O (N*N) What happens when the size of the list goes infinity??? What will happen to the number of operations?? 2 2 3 2
Big O: Made it Simple
Big O: Make it Simple
Big O: Make it Simple
Big O: Make it Simple
Big O: Make it Simple
Big O: Make it Simple
Big O: Make it Simple