📄 selectio.java
字号:
/*
* SelectionSortAlgorithm.java
* Patrick Morin takes no responsibility for anything. So there.
*
*/
/**
* A selection sort demonstration algorithm
* InsertionSortAlgorithm.java
*
* @author Patrick Morin
*/
class SelectionSortAlgorithm extends SortAlgorithm {
void sort(int a[]) throws Exception {
for (int i = a.length-1; i > 0; i--) {
int T = 0;
for (int j = 1; j <= i; j++) {
if(stopRequested) {
return;
}
if(a[j] > a[T]) {
T = j;
}
compex(j, T);
pause(i);
}
int temp = a[i];
a[i] = a[T];
a[T] = temp;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -