kanishka

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

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

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.

Where Next?

Popular in Chat/Questions Top

lc0815
hello from a real frustrated newbe… I’m reading this article Full-Stack React With Phoenix (Chapter 3 | Introduction to Phoenix) by mich...
New
New
OmanF
In the attached screenshot (taken from an exercise in “Programming Elixir”) can be shown that BugReport is defined as a struct that, itse...
New
mchean
I was wondering if anyone is using some learning tools that they can recommend? I’ve been looking at two specifically so would also be ...
New
imanuelgittens
Hey all! Just joined the forum and I’m very excited to learn the language. I just finished reading the documentation and I was wondering ...
New
jace
I wanted to write a library for interacting with a Web API as a practical way of learning Elixir. However, there seem to be a lot of diff...
New
phykos
In Ruby, which is very similar to Elixir I do this: def test yield end test do puts("sup there") end Here, the yield keyword will be...
New
AstonJ
It’s been a while since we asked this - I’m sure others (especially newcomers to the language) will be interested to hear how you’ve all ...
New
pdgonzalez872
Do we have a list of academic/research papers: about Elixir/Erlang? that use Elixir/Erlang? about the Beam? If so, could you please po...
New
AstonJ
It finally feels like I’ve got some time to catch up on my reading - though I am sure lots of people will be wondering the same: what are...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New

We're in Beta

About us Mission Statement