Flowchart (ISO 5807)
Source code
Java
class Sort {
static void selection(int[] a) {
for (int i = 0; i < a.length - 1; i++) {
int min = i;
for (int j = i + 1; j < a.length; j++) {
if (a[j] < a[min]) min = j;
}
int t = a[min];
a[min] = a[i];
a[i] = t;
}
}
}The editor opens with this code — change it and the chart redraws.
- Language
- Java
- Constructs
- selection sort
- Topic
- Algorithms
- Formats
- Word, Visio, draw.io, PDF, SVG