/primerDSA

Julia implementation of “The Last Algorithms Course You’ll Need” (Data Structures & Algorithms primer)

Primary LanguageJuliaApache License 2.0Apache-2.0

primerDSA

Julia implementation of “The Last Algorithms Course You’ll Need” by ThePrimeagen

that is to say: DSA (Data Structures & Algorithms) primer in Julia

folder src:

folder test:

why Julia ? it’s high-level enough to write easily like Python but much faster, without resorting to low-level C++ or worse Java headache

require Julia version ≥ 1.9

chapters: (my personal numbering)

  • chap 00 (no code): intro
  • chap 01 (code without unit test): big 𝒪 notation, array data structure
  • chap 02: linear search, binary search, 2 crystal balls
  • chap 03: bubble sort, linked list, queue, stack
  • chap 04 (no code): array list, array buffer
  • chap 05: recursion, path finding
  • chap 06: quick sort
  • chap 07: doubly linked list
  • chap 08: binary trees, tree traversal
  • chap 09: compare trees, tree search: breadth-1st, depth-1st
  • chap 10: heap, tries
  • chap 11: graphs, adjacency matrix, Dijkstra’s shortest path
  • chap 12: maps, LRU cache
  • chap 13 (no code): wrapped up

basic Julia setup

1st time creating julia package

julia> # press ] (without Enter)

(@v1.9) pkg> generate primerDSA
  Generating  project primerDSA:
    primerDSA/Project.toml
    primerDSA/src/primerDSA.jl

(@v1.9) pkg> # press Baskspace (without Enter)

julia> cd("primerDSA"); mkpath("test"); write("test/runtests.jl", """println("Testing...")""");

julia> # press ] (without Enter)

(@v1.9) pkg> activate ./test
  Activating project at `███/primerDSA/test`

(test) pkg> add Test
   Resolving package versions...
    Updating `███/primerDSA/test/Project.toml`
  [████████] + Test
    Updating `███/primerDSA/test/Manifest.toml`
  [████████] + Base64
  [████████] + InteractiveUtils
  [████████] + Logging
  [████████] + Markdown
  [████████] + Random
  [████████] + SHA
  [████████] + Serialization
  [████████] + Test

if already created package or cloned this repo

julia> # press ] (without Enter)

(@v1.9) pkg> activate ./primerDSA

(primerDSA) pkg> test