klaudiosinani / dsforest

Disjoint-set forests for ES6
MIT License
16 stars 0 forks source link

Add new `DisjointSet#makeSet(value)` class method (#3) #5

Closed klaudiosinani closed 5 years ago

klaudiosinani commented 5 years ago

Description

The PR introduces the following new unary method:

Mutates the disjoint-set forest by creating a new singleton set containing the element value with a rank of 0, a parent pointer to itself, indicating that the element is the representative member of its own set and a corresponding unique id. Returns the disjoint-set forest itself.

Also, the corresponding TypeScript ambient declarations are included in the PR.