Skip to content

Instantly share code, notes, and snippets.


Wis Scientits

View GitHub Profile
View quicksort.cpp
#include <bits/stdc++.h>
using namespace std;
/*this function: last element as pivot then places all smaller elements to the left, the others to the right*/
int partitioN(int a[], int low, int high){
int pivot = a[high]; // this is pivot
int i = (low - 1); // index of smaller elements
for(int j = low; j <= high - 1; j++){