Linda Okorie

Posted on

What Data Structures and Algorithms should mean to you

Cover Photo by Tim Gouw on Unsplash

Pursuing a career in Software Engineering is a lot of work. I get a lot of advice from different angles that it seems quite overwhelming. At different points part of the advice included studying Data Structures and Algorithms. One problem I had though was that I was never satisfied with the reasons I was given to study it (maybe that was why I was always scared of it).As a self taught developer who reads materials as it comes my way and relies on answers from Stack Overflow a lot, the only reason I could conjure up for studying DS & A (Data Structures and Algorithms) was I needed to know them in order to answer questions during interviews. It wasn't till I started reading that I understood how wrong I was.

Learning Data Structures and Algorithms isn't just about the interview β it goes beyond that. Have you ever wondered WHY companies want you to know these things? Its all about implementation! Data Structures were created to improve the time and space complexity. Algorithms are the steps taken to perform a given task. Now naturally, lesser steps would translate to smaller time. This is important to companies because time spent and space consumed translates to money β money for production, money for maintenance. If the software took too much time for work, it wouldn't be of much use to anyone. If it crashed as result, that would mean bringing more people in to fix it.

When we solve problems as newbies, we just hack till we find solutions. After doing this for a while, patterns begin to emerge. Now instead of going through the same painful process each time you need to solve a problem, DS & A helps us shorten the time it takes to craft a solution. Imagine immediately searching for a number in an array, I know immediately a binary search would be the fastest way to do it! It also optimizes operations for better efficiency β they take lesser time or lesser space (there are trade offs, through). A solution hacked together might work, but the difference in efficiency when compared to a solution carefully crafted using Data Structures is clear.

Bottom line, having knowledge of Data Structures and Algorithms is like a superpower. Its like the ultimate fashion trend that never goes out of style. You'll be able to implement it no matter the time or the language. Most books on the topic write solutions in pseudo code making it easier to understand despite your background. It also makes you see problems differently. Solving problems won't be about hacking things together anymore. There's a mathematical side to it all (the side that leaves me bewildered the most) but I suggest just trying to understand the basics first and ease into it slowly.

I'm still studying but would love learn more things that can be gotten out of DS & A.π

Chiko Mukwenha

Great post. What resources have you used that have enlightened you or made the topic exciting?

Ben Halpern

Great first post

Joost Helberg

Nice one! Other reasons, besides performance: correctness of implementations and better readability for others as the design is based on common knowledge.

Linda Okorie • Edited

Thanks. I see how that helps, especially when working in teams.

Thanks for the post. I've learned those last year but your post made me realise that I don't see myself using them in my job (well, apart from basic algorithms of course). So I'll dive more into DS & A and see if things I've coded could be improved.

Nyasha (Nash) Nziramasanga

Thanks for sharing this Linda, I have also been learning DS & A and I have realised a lot of my old code wasn't efficient because I used to just do the brute force method. DS & A has really helped in writing better efficient algorithms

Matthieu Cneude • Edited

Well, I would say: "it depends".

Depend on what? you might ask. Well, I'm a web developer for quite some time now, programming for even longer, and I rarely had to focus on algorithms to make my code more efficient.

Why? Because our hardware is so powerful nowadays, it doesn't matter if I do a bubble sort O(n^2) or a marge sort O(n).

So it depends of what you're doing. For web apps, what many people do, having this knowledge is not required to me. On the other side, if you work for the NASA or you code video games, you need to know that, and much more.

I'm trying to learn computer science at the moment, and I love it. Because I have some experience in development beforehand. It brings me some interesting foundations.

I wouldn't advise it to beginners though: it's difficult, if you're a Javascript developer for a small startup you won't necessarily see the application in your daily work, and you already need to manage so much only for your code to work, more or less, to maintain it, and to understand the code of others, among many other things.

David Dante Frank

Thanks a lot Linda. This was a great read. I have mulling over why I should learn DS & A and after reading this, it has become quite clear to me. What material would you recommend please?

Linda Okorie

I recommend starting out with videos on Big-O notation. It would put you more in the mood and open your eyes to how terrible the code we write is (had that effect on me).

David Dante Frank

Thanks. I'll do that

Awesome post! Thanks for encouraging me to study those more.

Bashir Hamza

This is a great post. I love it!!

SZ4M

Enjoyed reading the topic, currently, I have an introduction to DS&A, and after reading your topic I am more motivated.

Ilya Sher

searching for a number in an array

and then you a left with itching question whether it should be an array in the first place :)

Linda Okorie

ππ yeah should it be a linked list or a tree?! More nuances to it all.

Dani Amsalem

That's a great reason to study Data Structures & Algorithms. I'm a self-taught front-end dev as well and your article provided more clarity on the subject as well as nudging me to dig in.