DEV Community

Discussion on: A coffee-break introduction to time complexity of algorithms

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I understand that the casual use in coding is is different than math, but saying that is the "worst case" is also wrong for common coding.

We tend to consider hash maps O(1), vector add as O(1), map insert as O(log N), quicksort as O(N * log N), but none of those are true in the "worst case". We use average input case, typical case and amortized case on a regular basis, likely more common than worst-case when it comes to collections and common algorithms.