Add edges and update degrees
g [ 1 ] . push ( 2 ) ; g [ 2 ] . push ( 1 ) ; deg [ 1 ] ++ ; deg [ 2 ] ++ ; g [ 1 ] . push ( 5 ) ; g [ 5 ] . push ( 1 ) ; deg [ 1 ] ++ ; deg [ 5 ] ++ ; g [ 2 ] . push ( 3 ) ; g [ 3 ] . push ( 2 ) ; deg [ 2 ] ++ ; deg [ 3 ] ++ ; g [ 5 ] . push ( 3 ) ; g [ 3 ] . push ( 5 ) ; deg [ 3 ] ++ ; deg [ 5 ] ++ ; g [ 3 ] . push ( 4 ) ; g [ 4 ] . push ( 3 ) ; deg [ 3 ] ++ ; deg [ 4 ] ++ ; findSpanningTree ( deg , n , m , g ) ;