Flowchart (ISO 5807)
Source code
C++
void quickSort(int a[], int lo, int hi) {
if (lo >= hi) {
return;
}
int p = a[hi];
int i = lo;
for (int j = lo; j < hi; j++) {
if (a[j] < p) {
int t = a[i];
a[i] = a[j];
a[j] = t;
i++;
}
}
int t = a[i];
a[i] = a[hi];
a[hi] = t;
quickSort(a, lo, i - 1);
quickSort(a, i + 1, hi);
}The editor opens with this code — change it and the chart redraws.
- Language
- C++
- Constructs
- divide and conquer
- Topic
- Recursion
- Formats
- Word, Visio, draw.io, PDF, SVG