Publication View

Linear-time breadth-first tree algorithms An exercise in the arithmetic of folds and zips (1992)

Abstract
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...

Publication details
Download http://citeseerx.ist.psu.edu/viewdoc/summary?doi=?doi=10.1.1.32.5446
Source ftp://ftp.comlab.ox.ac.uk/pub/Documents/techreports/TR-31-92.ps.Z
Contributors CiteSeerX
Repository CiteSeerX - Scientific Literature Digital Library and Search Engine (United States)
Type text
Language English
Relation 10.1.1.42.1735, 10.1.1.31.5086, 10.1.1.11.2933, 10.1.1.121.9744