Program doesnt return to main after calling merge sort. Could someone point out why is that?

Code:private: int nNumItems; string *pasWords; ....more code .... int MergeSort(); int gMergeSort(string*pasWords, int nStart, int nEnd); int Merge(string*pasWords, int nStart, int nMidpoint, int nEnd);

after the red marked call to function, i tried putting a cout, but it just skips it and teriminates the program without going back to main.Code:int Wordlist::MergeSort() { int nStart=0, nEnd=nNumItems-1; if (pasWords == NULL) { cout << "Array is Empty..." << endl; return 0; } gMergeSort(nStart, nEnd ); return 0; } int Wordlist::gMergeSort(int nStart, int nEnd) { int nMidpoint=0; if (nEnd >= nStart+1) { nMidpoint = (nEnd-nStart)/2; //Getting Midpoint gMergeSort(nStart, nMidpoint); gMergeSort(nMidpoint+1, nEnd); Merge(nStart, nMidpoint, nEnd); } return 0; } int Wordlist::Merge(int first, int mid, int last) { int i,j,k; string *temp; temp = new string [(nNumItems-1)/2]; i=0, k=first; while(k<=mid) temp[i++]=pasWords[k++]; i=0,j=mid+1,k=first; for(;;) { if(temp[i]<= pasWords[j]) { pasWords[k++]=temp[i++]; if(i>mid-first) return 0; } else { pasWords[k++]=pasWords[j++]; if(j>last) break; } } while(i<=mid-first) pasWords[k++]=temp[i++]; return 0; }