Asymptotic complexities
Finding a pen in a classroom of n students
- O(n^2) – Asking each student and ask him about others too
- O(n) – Asking each student
- O(logn) – Dividing class equally and asking each half
- O(1) – Damn it, I have it in my pocket Person facepalming
Asymptotic complexities
Finding a pen in a classroom of n students
O(n^2) – Asking each student and ask him about others too
O(n) – Asking each student
O(logn) – Dividing class equally and asking each half
O(1) – Damn it, I have it in my pocket 🤦— Akash Singh (@iAkash_Singh) May 26, 2020