Arrays.sort()
- 자바 배열 정렬 함수
public static void main(String[] args) {
int numSort[] = {37,27,40,30,28,19};
Arrays.sort(numSort);
for(int i=0; i<numSort.length; i++) {
System.out.println(numSort[i]);
}
}
// 결과: 19 27 28 30 37
'알고리즘' 카테고리의 다른 글
[개념] KMP 알고리즘 (0) | 2020.01.04 |
---|---|
백준 1052. 물병 (C++) (0) | 2019.12.26 |
[자료구조] 우선순위 큐 (Priority Queue) (0) | 2019.12.24 |
백준 문자열 검색 주요 문제 모음 (0) | 2019.12.21 |
코드업 1714. 숫자 거꾸로 출력하기 (0) | 2019.11.17 |