[−][src]Crate tournament_tree
A library implementing a tournament tree data structure.
Tournament trees are, conceptually, complete binary trees holding the result of comparisons between each element of the tree. They can be used as a fixed size priority queue for applications like out-of-core sorting, or implementing many way joins.
use tournament_tree::TournamentTree; let mut data1 = vec![3, 1, 4, 1, 5, 2, 6, 5]; let tourney_tree = TournamentTree::from(data1.clone()); data1.sort_by_key(|&e| Reverse(e)); let data2: Vec<_> = tourney_tree.into_iter().collect(); assert_eq!(data1, data2);
Structs
IntoIter | An iterator that moves out of the tournament tree. |
Iter | Immutable tournament tree iterator. |
TournamentTree | A tournament tree. See the module documentation for more details. |
TournamentTreeIterator | A bounded priority queue using a |
TournamentTreeIteratorBuilder |