Initialise vis , dis , parent , preTime , and postTime
int [ ] vis = new int [ N + 1 ] ; int [ ] distance = new int [ N + 1 ] ; int [ ] parent = new int [ N + 1 ] ; int [ ] preTime = new int [ N + 1 ] ; int [ ] postTime = new int [ N + 1 ] ;