insertion sort 2


Submit solution

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

Authors:
Problem type
Allowed languages
Java 19, Java 8

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

題目說明

請使用插入排序法排序使用者輸入的整數陣列,之後輸入一欲查詢的整數,最後僅需輸出排序完的陣列以及輸入的數值在陣列第幾位,若無則輸出not found!

輸入限制 僅為整數

輸入

陣列空間,整數陣列,欲查詢整數

輸出

排序步驟的陣列,欲查詢整數在第幾位,僅需輸出最先找到的位置即可,若無則輸出not found!

測試資料0 輸入

6 2 3 1 4 6 5 6

測試資料0 輸出

1 2 3 4 5 6 5

測試資料1 輸入

3 60 20 21 2

測試資料1 輸出

20 21 60 not found!

Comments

There are no comments at the moment.