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

Introduction

·225 words·2 mins· loading · loading · ·
Programming
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: AI-Powered Web Apps
·5 mins· loading · loading
Programming
In the rapidly evolving backdrop of web development, LLMs have emerged as game-changers, offering unprecedented possibilities for creating dynamic and cutting-edge applications.
Building a Web Scraper to Generate PDF Manuals
·4 mins· loading · loading
Programming
What is Web Scraping? As the world is moving in the second decade of the 21st century, the recently famous proverb “Data is the new Oil” is getting more and more relevant. Web Scraping is a very useful technique to retrieve volumes of data from a working website. It can also be used to download files, images, texts and even to get live updates from single or multiple websites.
#100DaysOfCode
·2 mins· loading · loading
Programming
What is Tailwind CSS? Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override.