Data Structures and Algorithms with Elixir

Hello @jaeyson thanks for asking, I’m doing great. Hope you are too.

tl;dr All are stand-alone so you can just click on any link from README and start, but I’ll start with sort and search the terms on Wikipedia and mentally map the pseudocode/data-flow with the Elixir code (following test cases to double check my understanding).

And beyond that tl;dr…

Interesting questions. So far, every algorithm is stand-alone (i.e. no module aliases another, yet.)

So normally, when I was introduced with data structures and algorithms for the first time, I started with searching and sorting, Stack, then Queue and then LinkedList before all hell breaking lose. And when LinkedList, I meant linear linked list not double, circular, xor etc.

So I’d suggest maybe start with sort/ then stack/ and then list/? queue is interesting because of the way it deals with FIFO with zipper.

So normally, a data structure implemented here should first be looked at their respective .ex file, there are doctests to follow, but you can also click on the README links for tests. Some of the tests have Property Tests to give you a “meta” understanding of that data structure. For example, “if I have list of integer and I push them all into a stack and then pop them all out to another list, then they will be inverse of each other” is a statement that is true to any stack. Those tests also give some idea.

I DO have plans to add external links to these data structures so that once you’re looking into say, Catalan Numbers (inside number/) then you can go through all the links that explain it, and also an independent README inside all folders for a detailed discussion of it. But I kept that for future since I want to cover some algorithms first.

Please let me know if this helped, and feel free to suggest more properties or clarification and bugs when you encounter :slight_smile:

4 Likes