Results 1 -
1 of
1
Linear-time breadth-first tree algorithms An exercise in the arithmetic of folds and zips
- Dept of Computer Science, University of Auckland
, 1992
"... This is a paper about an application of the mathematics of zip, fold (reduce) and accumulate (scan) operations on lists. It gives an account of the derivation of a linear-time breadth-first enumeration function, and of a subtle and efficient breadth-first tree labelling function. 1 Breadth-first ord ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
This is a paper about an application of the mathematics of zip, fold (reduce) and accumulate (scan) operations on lists. It gives an account of the derivation of a linear-time breadth-first enumeration function, and of a subtle and efficient breadth-first tree labelling function. 1 Breadth-first ordering The algorithms which are developed in this paper relate trees to lists in a way that respects `breadth-first' ordering on the nodes of a tree. This is the order in which nodes nearer the root are considered to be earlier and -- perhaps arbitrarily, but for definiteness -- those at the same depth from the root are ordered lexicographically by the the `left to right' seniority of their line of descent. This paper works with rose trees, in which each node has an arbitrary finite number of immediate descendants tree ff = = ta where ta ::= Nd ff [ta] root(Nd a ts) = a subs(Nd a ts) = ts and will develop implementations of the breadth-first scanning and labelling functions bfs and lab b...

