Constructing the undirected graph
graph [ 1 ] . append ( 2 ) ; NEW_LINE graph [ 2 ] . append ( 1 ) ; NEW_LINE graph [ 3 ] . append ( 4 ) ; NEW_LINE graph [ 4 ] . append ( 3 ) ; NEW_LINE graph [ 4 ] . append ( 5 ) ; NEW_LINE graph [ 5 ] . append ( 4 ) ; NEW_LINE graph [ 6 ] . append ( 7 ) ; NEW_LINE graph [ 7 ] . append ( 6 ) ; NEW_LINE maxSubarraySum ( graph , V , values ) ; NEW_LINE