This function takes last element as pivot , places the pivot element at its correct position in sorted array , and places all smaller ( smaller than pivot ) to left of pivot and all greater elements to right of pivot
int partition ( char arr [ ] , int low , int high , int mod ) {