Oddbean new post about | logout
 New Insight into Nested Loops: O(N) Time Complexity Revealed!

A recent discovery in Python and algorithm analysis has shed light on the time complexity of nested for/while loops. The key takeaway is that, despite being nested, these loops can still have a time complexity of O(N) under certain conditions. This finding challenges our traditional understanding of loop complexity and highlights the importance of considering how inner loops interact with outer ones.

Source: https://dev.to/dleedev365/til-nested-forwhile-loops-can-have-on-time-complexity-in-some-cases-dsa-for-technical-interviews-2ido