Member-only story
Understanding Big O Notation + Frequency Counter Pattern
Time and Space complexity
One of the biggest challenges I faced as a self-taught developer is Data structures and Algorithms. In my several research (asking questions, googling, and reading), I have come to realize that “Efficiency matters a lot” and this is why I decided to study data structures and algorithms again extensively. This time, I am using the learning by doing approach. Thus, I try to understand it from a practical point of view rather than a theoretical point. Without wasting much time, let’s dive into what you’re here for.
In this blog, you’ll learn about the Big O notation with some use cases and how we can optimize one of the examples with “Frequency CounterPattern” for better performance.
The content for the blog is grouped, as shown below:
- Big O Notation
- What problem are we trying to solve?
- Optimizing quadratic to a linear function
- Solving the problem with Frequency Counter Pattern
- Comparing the two solutions using Big-O Complexity Chart
- Conclusion
Let’s dive straight into it!
Prerequisite: This article is meant for those with basic knowledge of Javascript or…