text: Check if current node ' s ▁ weight ▁ ▁ is ▁ same ▁ as ▁ root ▁ node ' s weight and if it is not visited or not
code: if ( weights [ i ] == root && visited [ i + 1 ] == 0 ) { document . write ( notroot + " " + ( i + 1 ) + " " ) ; visited [ i + 1 ] = 1 ; } } }