Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dylanirlbeck/disjoint-set-reason
An implementation of Disjoint Sets in Reason.
https://github.com/dylanirlbeck/disjoint-set-reason
Last synced: 2 months ago
JSON representation
An implementation of Disjoint Sets in Reason.
- Host: GitHub
- URL: https://github.com/dylanirlbeck/disjoint-set-reason
- Owner: dylanirlbeck
- License: mit
- Created: 2019-11-17T06:03:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T13:42:32.000Z (about 2 years ago)
- Last Synced: 2024-10-31T23:34:38.561Z (3 months ago)
- Language: JavaScript
- Size: 1.82 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# disjoint-set-reason
[![npm](https://img.shields.io/npm/v/disjoint-set-reason.svg)](https://www.npmjs.com/package/disjoint-set-reason)
An implementation of the [Disjoint Set data structure](https://en.wikipedia.org/wiki/Disjoint-set_data_structure) in [Reason](https://reasonml.github.io/en/).
## Example
```reason
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
```shell
yarn add disjoint-set-reason
```Then add `disjoint-set-reason` to `bs-dependencies` in your `bsconfig.json`:
```json
{
...
"bs-dependencies": ["disjoint-set-reason"]
}
```## Contribute
````
git clone https://github.com/dylanirlbeck/disjoint-set-reason
cd disjoint-set-reason
yarn```
````