Member-only story
Big O Explained in Pictures: Why Your Nested Loop Is Slow
Big O time is the language and metric we use to describe the efficiency of algorithms in mathematical way. Understanding it thoroughly can really help you in designing and writing algorithm. Remember that all applications are combination of small functions/methods with algorithm in it. Being able to understand the efficiency of an algorithm can help you determine efficiency of an application (although there are many factors involved in real world application)
Good example is change detection in Angular/React DOM tree as it involved the searching of DOM tree update in milliseconds. Many techniques like String manipulation, Dynamic Programming, DFS/BFS are used to find out the updates and also being efficiency enough to loop through out the DOM tree
Time Complexity
Big O doesn’t measure seconds. It measures how the number of steps grows when the input grows.
Think of a road trip. A fast car or a slow van changes the hours, but a trip twice as long is still twice the driving. Big O only cares about that “twice as long” part.









