klaudiosinani / dsforest

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

Add new `DisjointSet#getId(value)` class method. Fixes #3. #15

Closed klaudiosinani closed 5 years ago

klaudiosinani commented 5 years ago

Description

The PR introduces the following new unary method:

Returns the unique id that the given value element corresponds to and which is used as a key to point to the parent element of value in the parent associative array. If the given value element is not part of any disjoint-set, then undefined is returned.

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