Driver code to test above methods
int main ( ) { int edges [ ] [ 2 ] = { { 1 , 8 } , { 2 , 6 } , { 3 , 1 } , { 5 , 3 } , { 7 , 8 } , { 8 , 4 } , { 8 , 6 } } ; int N = sizeof ( edges ) / sizeof ( edges [ 0 ] ) ;