#structure #union-find #tarjan

disjoint-set

A implementation of Tarjan's Union-Find Data Structure

2 releases

Uses old Rust 2015

0.0.2 Mar 6, 2015
0.0.1 Mar 6, 2015

#1690 in Data structures

Download history 2350/week @ 2023-11-23 2889/week @ 2023-11-30 2003/week @ 2023-12-07 2982/week @ 2023-12-14 701/week @ 2023-12-21 825/week @ 2023-12-28 2808/week @ 2024-01-04 2233/week @ 2024-01-11 1706/week @ 2024-01-18 1846/week @ 2024-01-25 1939/week @ 2024-02-01 1145/week @ 2024-02-08 1010/week @ 2024-02-15 1547/week @ 2024-02-22 1021/week @ 2024-02-29 869/week @ 2024-03-07

4,900 downloads per month

MIT license

4KB
89 lines

union-find

A rust implementation of Tarjan's disjoint-set data structure with path compression optimization.


lib.rs:

Returns Some(num), num is the tag of subset in which x is. If x is not in the data structure, it returns None.
Union the subsets to which x and y belong. If it returns Ok, it is the tag for unified subset. it returns Err(), at least one of x and y is not in the disjoint-set.

No runtime deps