function toArray (span, root) {
  if(!span[root]) return null
  var a = [root]
  while(span[root])
    a.push(root = span[root])
  return a.reverse()
}
//convert a spanning tree to an array.
convert a spanning tree to an array.
convert a spanning tree to an array .
function toArray (span, root) {
  if(!span[root]) return null
  var a = [root]
  while(span[root])
    a.push(root = span[root])
  return a.reverse()
}
function toArray ( span , root ) { if ( ! span [ root ] ) return null var a = [ root ] while ( span [ root ] ) a . push ( root = span [ root ] ) return a . reverse ( ) }
convert a spanning tree to an array.
convert a spanning tree to an array .