8 releases

0.1.7 Nov 26, 2023
0.1.6 Nov 26, 2023
0.1.3 Oct 30, 2023

#701 in Data structures

Download history 25/week @ 2024-07-28 9/week @ 2024-09-22 3/week @ 2024-09-29

65 downloads per month

Custom license

9KB
162 lines

Tord

Tord is a simple data structure to store transitive relations

Usage

use tord::Tord;

fn main() {
	let mut t = Tord::new();
	t.insert((5, 6));
	t.insert((6, 10));
	t.insert((10, 19));

	// We did not add (19, 6) but because of Transitivity,
	// this relation exists
	if t.check_relation((19, 6)) { 
		println!("Found it!");
	} else {
		println!("Relation does not exist");
	}
}

No runtime deps