Results 1 
1 of
1
Lineartime breadthfirst 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 lineartime breadthfirst enumeration function, and of a subtle and efficient breadthfirst tree labelling function. 1 Breadthfirst ord ..."
Abstract

Cited by 7 (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 lineartime breadthfirst enumeration function, and of a subtle and efficient breadthfirst tree labelling function. 1 Breadthfirst ordering The algorithms which are developed in this paper relate trees to lists in a way that respects `breadthfirst' 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 breadthfirst scanning and labelling functions bfs and lab b...