Skip to content
/ algox Public

Common Algorithms and Data Structures implemented using Elixir

Notifications You must be signed in to change notification settings

jaeyson/algox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algox

Data structures and Algorithms using Elixir Language

Dependabot Actions Status Coverage

Files

defmodule Algox.BinarySearch do
@moduledoc """
Binary search: marking the middle element
in a list as pivot (starting point) before
making any search. Do note the
implementation needs to sort the list.
Returns the index position or nil.
"""
defmodule Algox.LinearSearch do
@moduledoc """
Linear search: needs to traverse the
entire list in order to find the target.
Returns the index position or nil.
"""
defmodule Algox.QuickSort do
@moduledoc """
Quick sort: in this version, it picks
the first element as pivot, then inserts
the pivoted element in between the
lesser numbers and greater numbers.
Accepts integer and returns empty list
or list of integers.
"""
defmodule WalkOnMatrix do
@moduledoc """
Walk on matrix: Think of these as "spiral"
walking until you hit the center of it.
You start at the very leftmost part, then
traverse in spiral fashion (or like snake,
let your imagination flow) until you hit
the center. We'll use nested list integers
as an example input.
Accepts 2-dimensional list of integers
and returns 1-dimensional list of all
integers according on the order of
walking.
"""

Benchmarks

using mix task:

# file names found in lib/algox dir
mix benchmark binary_search

mix benchmark quick_sort

About

Common Algorithms and Data Structures implemented using Elixir

Topics

Resources

Stars

Watchers

Forks

Languages