question: public void buildSpanningTree ( Node root ) { super . clearEdges ( ) ; super . setRoot ( root ) ; LinkedList q = new LinkedList ( ) ; BitSet visit = new BitSet ( ) ; q . add ( root ) ; visit . set ( root . getRow ( ) ) ; Table edges = getEdgeTable ( ) ; while ( ! q . isEmpty ( ) ) { Node p = ( Node ) q . removeFirst ( ) ; for ( Iterator iter = p . edges ( ) ; iter . hasNext ( ) ; ) { Edge e = ( Edge ) iter . next ( ) ; Node n = e . getAdjacentNode ( p ) ; if ( ! visit . get ( n . getRow ( ) ) ) { q . add ( n ) ; visit . set ( n . getRow ( ) ) ; int er = super . addChildEdge ( p . getRow ( ) , n . getRow ( ) ) ; edges . setInt ( er , SOURCE_EDGE , e . getRow ( ) ) ; } } } }
target:  Build the spanning tree, starting at the given root. Uses an unweighted breadth first traversal to build the spanning tree.