#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

#1912 in Data structures

Download history 639/week @ 2024-07-27 84/week @ 2024-08-03 348/week @ 2024-08-10 361/week @ 2024-08-17 442/week @ 2024-08-24 536/week @ 2024-08-31 655/week @ 2024-09-07 579/week @ 2024-09-14 559/week @ 2024-09-21 633/week @ 2024-09-28 479/week @ 2024-10-05 536/week @ 2024-10-12 296/week @ 2024-10-19 537/week @ 2024-10-26 341/week @ 2024-11-02 328/week @ 2024-11-09

1,571 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