insertion sort 1


Submit solution

Points: 40 (partial)
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem type
Allowed languages
Java 19, Java 8

請同學確認評判語言後再行繳交,若繳交有誤請試著更改版本再試一次
若因評判語言不符合預期而導致分數有落差,將不予考後重新評判

題目說明

請使用插入排序法排序使用者輸入的整數陣列,並依步驟輸出陣列

輸入限制 僅為整數

輸入

陣列空間,整數陣列

輸出

排序步驟的陣列

測試資料0 輸入

6 2 3 1 4 6 5

測試資料0 輸出

2 3 1 4 6 5 
2 3 1 4 6 5
1 2 3 4 6 5
1 2 3 4 6 5
1 2 3 4 6 5
1 2 3 4 5 6

測試資料1 輸入

3 60 20 21

測試資料1 輸出

60 20 21 
20 60 21
20 21 60

Comments

There are no comments at the moment.