4 Big Rules Every Coder Should Know on Data Structures and Algorithms
If you’re a regular person who opens his computer every morning, writes lines of code, and has fun with coding (:
You’ve probably heard that data structures and algorithms are so crucial for programmers (especially if you want to be a good one)
But wait a moment! Why should we bother learning about data and algorithms?
Well, it’s pretty straightforward. Think about it:
How many people in your company make $100,000 per year? How many cities with over 250,000 people are between Dallas, Texas?
There are many questions like these where we don’t have enough information to answer them.
So, we need to represent that information in a way that lets us find answers quickly and get what we need.
This data representation and manipulation is a fundamental concept at the heart of computer science.
Now, you might think, “Do we even need to learn them when computers are getting faster and faster these days?”
That’s a good question, so let’s break it down…
Do We Really Need to Write Efficient Programs if Computers Are Getting Faster?
I totally agree that the processor speed and memory capabilities of a computer continue to improve. . .
But just thinking that every problem we have today will automatically be solved using tomorrow’s hardware is not going to happen.
Because, looking back in time, we’ve seen this pattern happen a lot before.
Each time when computers were improved with new advanced capabilities, we utilized that to solve even more complex problems.
Let me give you some examples of problems that have been solved efficiently with modern computers:
- Creating advanced user interfaces
- handling large data sets
- solving problems that were thought impossible to improve due to their complexity.
To sum up, don’t just trust a machine that understands only ones and zeros and focus more on efficient ways to solve problems.
Now, after clarifying some common misconceptions and getting those basics down, let’s dive into the main topic of this article…
Four Big Basic Principles of Data Structures and Algorithms for Every Programmer
1. Know the Costs and Benefits: Each data structure and algorithm has costs and benefits
If you know how to figure out how to assess costs and benefits, you’ll be able to handle and adapt to any new design challenge that comes your way.
2. Think About Tradeoffs
For example, we may reduce time requirements at the expense of space requirements or vice versa.
All programmers face these tradeoff issues frequently in software design and implementation.
It’s like picking between pizza and ice cream — both are great, but you must choose!
3. Learn What Others Do: Programmers should know enough about commonly used practices
We need to understand the widely used data structure, their related algorithms, and the common design patterns we see often.
This helps us avoid wasting time and effort on problems that already have solutions. Instead of starting from scratch, we can use what’s already out there.
4. Full fill what’s needed: Data structures follow needs
Every programmer’s challenge is to find the specific requirement of the application he builds.
Based on those requirements, we should look for a data structure that fits those needs and fulfill them to do a specific task.
That’s it! Don’t forget to hits that follow button to get notified when new materials are released.
See you in the following article!