Why Learn Data Structures and Algorithms?


Millions of programmers are looking forward to pursuing a career in dream software companies. On average, a dedicated programmer spends hundreds of hours learning data structure and algorithms for the coding interview. Unfortunately, some struggle to become good at it and crack the coding interview. There are several reasons, but one critical reason is the lack of motivation and long-term interest in learning data structure and algorithms.

So what are the key ideas for developing long-term term motivation? Why algorithms and data structure are essential for achieving a dream career in programming? How does it help us to become smart problem-solvers? Let's find out the answers to these fundamental questions.

I would like to start with a story of learning data structure and algorithms!

I had never used computers before entering college. Even I got poor grades in programming course during the 1st year. I had started talking to seniors about this failure but still did not get a clear direction. Somehow I had managed to persuade myself to leave the idea of a career in computer science. But as Steve Jobs said: "we can’t connect the dots looking forward; we can only connect them looking backward."

When I was in 3rd year, one of my friends explained the recursive algorithm to print the nth Fibonacci number. He told me that this is a bad code because the computer would take several years to produce the output for a large value of n!!! I said: “Really. How??? ”He said: “Time complexity of this algorithm is an exponential function of n”. He immediately explained the idea of time complexity and gave the proof.

I was amazed and asked: “Why did most students write this code during the 1st-year examination?”. He smiled and said:  Because they had memorized it and never thought about its performance!”. Further, he explained a better solution via the bottom-up dynamic programming approach [O(n) time and O(n) space]. He further optimized it to a single loop solution with constant extra space [O(n) time and O(1) space].

This was the first incident when I came very close to understanding the importance of algorithms, which helped me change my mind. I understood one thing clearly: an algorithm is about performance, and a bad algorithm is always a failure even if you have good hardware. I started going through several basic problems and comparing the efficiency of their solutions. It gave me an amazing feeling! Even curiosity was so high that I studied the book CLRS twice. Now the situation is totally opposite: learning algorithms and data structure is my passion.

Why Data Structures and Algorithms are Important to Learn?

Good knowledge of programming languages is necessary but not sufficient. The real joy comes when we have good command over DS algorithms and problem-solving. I believe that good problem-solving practice can change the way we think about algorithms and help us grow to new heights in our careers. After four years of teaching experience with thousands of students and professionals, sharing the four good reasons to learn Data structure and Algorithms.

An Algorithm is a Technology

The system performance depends on choosing efficient algorithms as much as on choosing fast hardware. Even applications that do not require algorithms directly at the application level…relies heavily upon algorithms. For examples:

  • Does the application rely on fast networking? Computer networking relies heavily on routing algorithms.
  • Does the application depend upon the user interface? The design of the user interface relies on algorithms.
  • Does the application require fast hardware? The hardware design used algorithms.

Overall, algorithms are at the core of most real-life applications. Just as rapid innovations are being made in other computer technologies, they are also being made in algorithms.

They are at the Core of Library Functions and APIs

Learning Algorithms and Data Structures might seem unnecessary in an age where we will be using library functions for 90% of our coding. But, why should we bother to learn the implementation when the implementation is hidden behind an abstraction? In such a situation, we must learn data structures and algorithms to understand the logic behind the behavior of these abstractions. If we don’t then, we will eventually apply them in a way that will hurt you.

Important for Cracking the Coding Interview

Why do tech companies test the knowledge of DSA during the interview process? The answer would be obvious — these companies encounter problems daily that are complex and large on the scale of data, and they would like to hire an intelligent programmer who can solve those problems in minimal time, using the least number of resources. So the knowledge of Data Structures and Algorithms is a clear indicator of the programmer’s abilities in solving those problems efficiently.

Algorithms are Beautiful

Algorithmic logic is part of beautiful natural patterns and real-life activities. There is immense satisfaction when we visualize working our way to an understanding of them. They are compact and simple pieces of logic work perfectly to perform a single task. Here is the best quote from the "father of the analysis of algorithms" Donald Knuth: " People who analyze algorithms have double happiness. First of all, they experience the sheer beauty of elegant mathematical patterns that surround elegant computational procedures. Then they receive a practical payoff when their theories make it possible to get other jobs done more quickly and economically".

Suggested Blogs to Start DSA Journey

Enjoy learning, Enjoy coding, Enjoy algorithms!

More From EnjoyAlgorithms

Our weekly newsletter

Subscribe to get free weekly content on data structure and algorithms, machine learning, system design, oops design and mathematics.

Follow Us:


© 2020 EnjoyAlgorithms Inc.

All rights reserved.