Buckle Up: Common Data Structures and Algorithms Implemented in Swift

Braden Casperson
3 min readJun 6, 2018

Well, I’ve been wanting to learn the dirty of data structures and algorithms for a while now. I wasn’t a CS major. I got two business degrees that had a technology emphasis. So, my understanding of the guts of programming is less…in-depth as others’. My programming learning has mainly been on-the-job and through personal projects, as is the case with many of you. I’ve started to read and learn and experiment practice and have decided to do what programmers do and write a blog post(s) about it.

Now, there could be any number of thoughts going through your head right now:

Will I really be able to learn this smart, computer-sciency stuff?

What use is knowing any of this if I never use any of it in my day-to-day work?

I’ve got an interview coming up next week. Can I learn this all in time?

Who does this guy think he is? He’s a n00b who wants to think he knows stuffs.

Great thoughts! Before I briefly address these thoughts, let me preface it with something. I kind of have no idea what I’m talking about. I 👏 am 👏 learning 👏. I code in Swift everyday, so naturally, that’s what I’ll use as my vessel, transporting me through this mind-bending, confusing, fulfilling journey.

First, will you be able to learn this? Absolutely…if you try hard. This is literally just practice makes perfect stuff. If you do it enough and practice enough, you will learn it.

Second, what’s the use? I contemplated this for a while and it’s only after really diving into these things that I am beginning to realize that these actually are valuable outside of programming interviews. Sometimes. There is a huge range of problems and tasks that we work on as developers, sometimes difficult, sometimes trivial. A lot of times we may learn one way of solving something and that becomes our go-to for every other problem that arises. This is fine a lot of the time. But sometimes there is a better way, and you just don’t know about it. All these algorithms and different data structures were created for a reason and became popular for a reason. They solve problems that occur often. Learning these things really opens your mind to some more critical thinking. You’ll begin to approach your work a little differently, really considering the way you’re building something to determine if there is a better way. You’ll also feel more confident overall. Plus a bunch of other reasons.

Third, probably not. If you’ve done lots of this stuff in your past and you just need a refresher, maybe. But if you’re like me and you’re learning for the first time (and you’re a normal, average human being) then I’m going to say no. Sorry. It’s a lot of stuff that honestly will take a bit of time to really sink in. But, it will sink in. Don’t you worry, my dear.

Fourth, I don’t think I’m anybody. I whole-heartedly recognize that I am a n00b and I embrace that. I don’t know a lot of things. I’m blogging about it to help me to learn, not you. Okay, maybe a little bit for you too. But mostly for me 😈.

Let me know what you guys think about this decision to write articles on the different algorithms and data structures. I’m always looking for advice and feedback in general, so don’t be shy.

--

--

Braden Casperson

CEO & Co-founder @GroovieInc | Senior iOS Engineer @HearsaySystems. I like my instant pot, and I fake skateboarding with the teens. braden.io