Data Structures and Algorithms


Keywords
algorithm, bfs, bst, cross, cycle detection, data, dfs, dictionary, graph, hash, hash table, heap, js, priority queue, red black tree, search tree, select, shuffle, sort, struct, structure, topological sort, utility
License
GPL-2.0+
Install
haxelib install struct 0.11.0

Documentation

struct

General purpose data structures and algorithms.

Data Structures

  • Dictionary
    • Array Bag
    • List Bag
    • Array Stack
    • List Stack
    • Array Queue
    • List Queue
  • Priority Queue
    • Array Unordered Priority Queue
    • Array Ordered Priority Queue
    • Binary Heap Priority Queue
    • N-ary Heap Priority Queue
    • Fibonacci Heap Priority Queue
  • Search Tree
    • List Unordered Symbol Table
    • Array Ordered Symbol Table
    • Binary Search Tree
    • 2-3 Search Tree
      • Left Leaning Red-Black Binary Search Tree
    • B Tree
    • B+ Tree
  • Hash Table
    • List Unordered Hash Table
    • Array Ordered Hash Table
    • Binary Search Tree Hash Table
    • Red-Black Binary Search Tree Hash Table
    • Separate Chaining Hash Table
    • Linear Probing Hash Table
  • Graph
    • Directed Matrix Graph
    • Undirected Matrix Graph
    • Directed Adjacency Graph
    • Undirected Adjacency Graph
    • Directed Edged Graph
    • Undirected Edged Graph
    • Flow Capacity Graph

Algorithms

  • Sort
    • Array Comparator Network Sort
    • Array Bubble Sort
    • Array Selection Sort
    • Array Insertion Sort
    • Array Shell Sort
    • Array Merge Sort
      • Array Bottom Up Merge Sort
    • Array Quick Sort
      • Array Three Way Quick Sort
    • Binary Heap Sort
  • Shuffle
    • Sort Shuffle
    • Knuth Shuffle
  • Select
    • Array Quick Select
    • Array Binary Search
  • Graph Operations
    • Depth First Search
    • Breadth First Search
    • Connected Components
    • Strongly Connected Components
    • Bipartite Components
    • Cyclic Components
    • Euler Tour
      • Visit each edge once
    • Topological Sort
  • Graph Minimum Spanning Tree
    • Lazy Prim's Minimum Spanning Tree
    • Eager Prim's Minimum Spanning Tree
    • Kruskal's Minimum Spanning Tree
    • Euclidean Minimum Spanning Tree
  • Graph Shortest Path
    • Dijkstra's Shortest Path
      • Non-negative weights
    • Bellman-Ford Shortest Path
      • No negative cycles
    • Topological Sort Shortest Path
      • No directed cycles
  • Graph Flow
    • Ford-Fulkerson Maximum Flow

Tests

Run the unit tests using Massive Unit.

haxelib run munit test

If you wish to run tests against just one target, say Javascript, simply add the target name to the end, like so:

haxelib run munit test -js

You can find the full list of available platforms in test.hxml, which is the configuration file used by the Haxe compiler when running Massive Unit.

If you wish to run tests against the C++ target, you will need to install HXCPP first.

haxelib install hxcpp
haxelib run munit test -cpp

Cross Platform

This library is written in Haxe, which transpiles or compiles to many target languages and platforms. Therefore, this library is cross platform, and can be built and compiled/linked/required/imported into many varied projects.

As the author of this project, I cannot take credit for that, and instead it goes to the amazing technology under the hood of Haxe. If you think that is cool why not give Haxe a go?

Author

Brendan Graetz

Licence

GPL-3.0