1 unstable release

0.1.0 Jul 6, 2020

#2654 in Data structures

MIT/Apache

10KB
236 lines

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);

No runtime deps

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy