Professional Documents
Culture Documents
# Include // To Swap Two Numbers Void Swap (Int A, Int B) (Int T A A B B T )
# Include // To Swap Two Numbers Void Swap (Int A, Int B) (Int T A A B B T )
h>
// to swap two numbers
void swap(int* a, int* b)
{
int t = *a;
*a = *b;
*b = t;
}
int partition (int arr[], int low, int high)
{
int pivot = arr[high]; // selecting last element as pivot
int i = (low - 1); // index of smaller element
Output:
Enter how many elements you want to have for sorting
5