[][src]Function adapton::catalog::collections::mergesort_list_of_tree

pub fn mergesort_list_of_tree<X: 'static + Ord + Hash + Debug + Clone, Lev: Level, T: TreeElim<Lev, X>, L: ListIntro<X> + ListElim<X> + 'static>(
    tree: T
) -> L

Demand-driven sort over a tree's leaves, whose elements are Ord. To the extent that the tree contains names, the output is lazy, and thus sorts on-demand. Demanding the first element is O(n) for a tree with n leaves. Demanding the next element requires more comparisons, but fewer than the first element. Demanding the last element requires only O(1) comparisons. In total, the number of comparisons to demand the entire output is, as usual, O(n ° log(n)).