JAVA
[JAVA] 큐 정렬하기 Queue<String> sorting
코딩일자무식할아버지
2020. 12. 1. 13:18
가장 작은 index를 리턴하고 후에 sotrIndex 파라메터를 queue.size() - i 로 조정해주면서 오름차순 정렬이 된다.
minIndex 위치의 값을 queue의 마지막에 add해준다.
for문으로 두 메서드를 실행해서 queue 내부 데이터를 오름차순으로 만들어준다.
<결과>
www.geeksforgeeks.org/sorting-queue-without-extra-space/ 에서 Queue<Integer> 형식의 sorting 방법을 참고함.
Sorting a Queue without extra space - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org