Member-only story

Understanding Big O Notation + Frequency Counter Pattern

Time and Space complexity

Josephine Gyamera
6 min readJan 10, 2021
Images by Pixabay

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:

  1. Big O Notation
  2. What problem are we trying to solve?
  3. Optimizing quadratic to a linear function
  4. Solving the problem with Frequency Counter Pattern
  5. Comparing the two solutions using Big-O Complexity Chart
  6. Conclusion

Let’s dive straight into it!

Prerequisite: This article is meant for those with basic knowledge of Javascript or

--

--

Josephine Gyamera
Josephine Gyamera

Written by Josephine Gyamera

Just learning cool Tech stuffs😎

No responses yet