Skip to main content
  1. Portfolios/
  2. Datastructures & Algorithms in Elixir/

Introduction

·225 words·2 mins· loading · loading · ·
Ch Virinchi
Author
Ch Virinchi
Elixir programmer, rocket propulsion enthusiast. Web Application developer.
Table of Contents
Elixir DSA - This article is part of a series.
Part 1: This Article

Data Structures & Algorithms in Elixir

Introduction

What happens if you learn Elixir as your first programming language?

Follow along on this journey, as I learn Elixir and try to implement famous Data Structures and Algorithms in Elixir.

People often find it strange that for all the clout around Elixir, it doesn’t have for-while loops or if-else blocks. Yet, it is true. Elixir discourages the use of for-while loops & if-else blocks. Being an immutable language, it discourages the typical use of i += 1 type code in loops.

Yet, for all its strangeness, it still stands out in the crowd.

Elixir is massively fault-tolerent, scalable and supports concurrency right out of the box. The pipe operator makes the syntax clean and readable, giving you a clear idea about the control flow.

Instead of if-else blocks, we have recursion & pattern matching. Any block of code has a few functions calling each other with different arities multiple times. Recursion and pattern matching form the crux of functional programming in Eliixr.

Enough said. Let’s get started.

First up, the sorting algorithms-

Tip: I’d recommend checking out the Elixir docs and Elixir Lang docs if you’re new to Elixir. Pattern matching, recursion and the pipe operator are a must to check out before starting.
Tip: All the code we will write is checked into this Git Repo
Elixir DSA - This article is part of a series.
Part 1: This Article

Related

Integrating Sonnet 3.5 with Phoenix Liveview
·5 mins· loading · loading
In the rapidly evolving backdrop of web development, LLMs have emerged as game-changers, offering unprecedented possibilities for creating dynamic and cutting-edge applications. The possibilities are endless.
Adikailash trip
·15 mins· loading · loading
Tip: Be sure to turn on ZenMode using the button on right side of the like button for a better reading experience #Day 0 27th May Post my JEE exam on 26th, we set off from Vizag on 27th afternoon, headed to our base camp, Vizianagaram.