A utility function to do DFS for a 2D boolean matrix . It only considers the 8 neighbours as adjacent vertices
void DFS ( char mat [ ] [ COL ] , int row , int col , int prevRow , int prevCol , char * word , string path , int index , int n ) {