kanishka
Anybody attempted Coursera's "Advanced Algorithms and Complexity" with Elixir?
Has anybody attempted to do exercises for https://www.coursera.org/learn/advanced-algorithms-and-complexity using Elixir? I might try in a week and I was hoping to hit the ground running.
Most Liked
al2o3cr
I can’t speak to that particular course, but in general you might encounter some headaches doing “traditional” data-structures work in Elixir because the textbook algorithms frequently rely on mutable state.
For instance, structures like a queue that would be represented with a doubly-linked list need to be more clever with immutable data - take a look at the :queue module in the Erlang standard library.
Some things might also be easier: for one, network flows sound like the :digraph module might help.
stevensonmt
You can use a gen server to mimic mutable state. I have had to resort to that for certain Leetcode problems where the tests are not written with immutable state in mind. Before I get caught out, let me just say that I know that is not really the use case for gen servers exactly. But in certain situations it’s the best workaround that I have found.







