Skip to content

dylanirlbeck/disjoint-set-reason

Repository files navigation

disjoint-set-reason

npm

An implementation of the Disjoint Set data structure in Reason.

Example

open DisjointSet;

let disjoint_set = makeSet(10); // Creates a Disjoint Set with a size of 10.
disjoint_set -> union(2, 3); // Union set 2 with set 3.
let twos_parent = disjoint_set -> find(2); // Find 2's parent.
Js.log(twos_parent); // Prints out '3'.

Installation

yarn add disjoint-set-reason

Then add disjoint-set-reason to bs-dependencies in your bsconfig.json:

{
  ...
  "bs-dependencies": ["disjoint-set-reason"]
}

Contribute


git clone https://github.com/dylanirlbeck/disjoint-set-reason
cd disjoint-set-reason
yarn

```

About

An implementation of Disjoint Sets in Reason.

Resources

License

Stars

Watchers

Forks

Packages

No packages published