newton-peixoto
Is it possible to implement all known algos within elixir?
Hello everyone, I’d like to know if is possible to execute all “populary known” algorithms in elixir. I’m asking that because most of algorithms use arrays for example and as far as I known elixir does not implement those so my question is if is possible to implement such algorithms with the same performance as in those languages that implement such data-structures.
Most Liked
benwilson512
Algorithms designed around mutable datastructures will not translate directly into Elixir, nor will they perform the same. If you’re trying to get things done in Elixir this generally isn’t an issue as it just pushes you to reframe the problem into something more amenable to immutable datastructures, which gets you some side benefits along the way.
If your goal is to practice algorithms on mutable datastructures however then I’d pick a language that has those natively.
hauleth
Indeed. Because it is list, and advancing iterator over list is O(n) not O(1)
hauleth
Possible to implement - yes. Will these perform equally well as in other languages? It depends on the algorithm. If such algorithm requires random access structures that can be cheaply updated, then implementing them in performant manner in Elixir will be hard, but you still will be able to do so (as per Church-Turing thesis).







