DEV Community

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

Collapse
 
hepisec profile image
hepisec

Hi Vicky, great article! However I think your pizza examples still have O(n) complexity although they have nested loops. The inner loops can be assumed to run in constant time O(1) as the number of slices per pizza and the number of pizzas per box is more or less constant.