Function to find sum of the given Circular linked list
function sumOfList ( head ) { var temp = head ; var sum = 0 ; if ( head != null ) { do { temp = temp . next ; sum += temp . data ; } while ( temp != head ) ; } return sum ; }