Driver code
let V = 5 ; let adj = new Array ( V ) ; for ( let i = 0 ; i < V ; i ++ ) { adj [ i ] = [ ] ; } adj = addEdge ( adj , 0 , 1 , 10 ) adj = addEdge ( adj , 0 , 4 , 20 ) adj = addEdge ( adj , 1 , 2 , 30 ) adj = addEdge ( adj , 1 , 3 , 40 ) adj = addEdge ( adj , 1 , 4 , 50 ) adj = addEdge ( adj , 2 , 3 , 60 ) adj = addEdge ( adj , 3 , 4 , 70 ) printGraph ( adj , V ) ;