A utility function to swap two elements
| 4 | |
| 5 | // A utility function to swap two elements |
| 6 | void swap(int* a, int* b) |
| 7 | { |
| 8 | int t = *a; |
| 9 | *a = *b; |
| 10 | *b = t; |
| 11 | } |
| 12 | |
| 13 | /* This function takes last element as pivot, places |
| 14 | the pivot element at its correct position in sorted |