/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/quicksort3 * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include #include #include using namespace std; // A new way of partitioning. int n; void quicksort(int arr[], int st, int ed) { if (st >= ed) return; int pivot = arr[ed]; int i=st,j=st; for (j=st;j