Code is not working pls check

compiler error 
  1. segmentation araa hai - remove this by making graph size n+1 instead of n in the contructor.
  1. logic mai issue for that tell me ur approach on 8368547890

https://ide.codingblocks.com/s/339408 actually my code is not running for the notes which are not directly connect pls correct my code

plz call me on 8368547890.