Data Structures and Algorithms in Go
Even with the rapid advancement of AI, one truth remains unchanged: the fundamentals of engineering still matter. Tools may evolve, but a deep understanding of core concepts is what enables us to build efficient and reliable systems.
At the heart of this foundation are data structures and algorithms. Understanding data structures deeply allows us to:
Choose the most appropriate way to organize data
Determine which algorithms will work efficiently on that data
Make informed decisions when solving real-world problems
When approaching any problem, the process should be intentional:
Understand the problem clearly
Select the most suitable data structure
Determine the operations that will be performed
Choose or design the most efficient algorithm
The key insight is simple but powerful:
The choice of data structure directly influences the efficiency of the algorithm.
By mastering these fundamentals, we don’t just write code—we design systems that are scalable, maintainable, and performant.
So what is Data structures? - This is just how computers stores data in their memory with the goal of making sure that when data data is needed it is retrieved as fast as possible and in an efficient way without sacrificing system resources.
What is an algorithm? This is just step by step process of solving a problem. In terms of Data Structures, it is steps of solving problems or challenges related to a particular structure with the goal of making it efficient and to be the most correct algorithm. Basically a good algorithm has the following characteristics:
1. Correctness - The algorithm should be as correct as possible with minimal to no mistakes.
2. Efficiency - The algorithm should be as efficient as possible. There are two ways of checking efficiency of an algorithm:
Time complexity - This is how fast the algorithm takes to work on a particular problem. Or how fast result is provided by an algorithm. This is usually measured in this function T(n) - Where "T" is time taken verses "n" which is the input size
Space complexity - This is how much RAM is being used by the algorithm to return the desired results. This is measured in S(n) - Where "S" is the memory used and "n" is the size of the input.
Now that we understand all that, we need to understand something else: Asymptotic analysis.
Asymptotic Analysis
What is asymptotic analysis: This is basically how an algorithm behaves when the input size grows (n -> ∞) . We do not really care about how fast an algorithm is, or the hardware we have, or programming language but we only care if the algorithm will scale beautiful if the input would grow to a specified capacity. Their are three notation to this: Big-O(Worst case), Omega(Best case), Theta(Exact growth/real behavior)
Big-O Notation(Worst case scenario - Upper bound)
This is also called worst case scenario, here we are trying to understand the upper bound of this algorithm. This gives us the maximum time the algorithm can take before it gives us a desired output. It is usually like this:
f(n) = O(g(n)): This means f(n) does not grow faster than g(n), after some large n
Example f(n) = n^2 + n: This means as the input grows, n^2 becomes more dominant, and n becomes irrelevant. So that means Big-O is O(n^2). This is the worst case scenario.
Omega(Best Case Scenario - Lower Bound)
This tells us the minimum time our algorithm will take. We could simplify it by saying this:
f(n) = Ω(g(n)) which means:
f(n) grows at least as fast as g(n)
Theta(Exact growth/real behavior)
This tells us tight bound (real behavior)
We could say it in this way that:
f(n) = Θ(g(n)) which means:
f(n) grows at the same rate as g(n)
But asymptotic analysis is not really good for small inputs, it is only explicitly good for large data sets.
Example:
Algorithm A:
10000 * n log n
Algorithm B:
n^2
Asymptotic says:
n log n is better than n^2
TRUE for large n
But If n is small:
10000 * n log n can be slower
n² can be faster
Lesson:
Asymptotic analysis only tells the truth for large inputs
So why then do we keep using it either way?
1. Because in real systems:
2. Data grows BIG
3. Performance matters at scale
That’s where asymptotic analysis becomes accurate and powerful
In your journey (software engineering, systems, scalability):
Asymptotic analysis helps you:
Choose efficient algorithms
Design scalable systems
Avoid performance bottlenecks.
Now that we understand this quite better, in the next episode we will try and understand the complexity analysis of algorithms. We will discuss about worst case, best case and average case and Time complexity Order and other cool stuff. Stay tuned!

