Insertion Sort

easy

Mô tả

Cài đặt thuật toán sắp xếp chèn (Insertion Sort) để sắp xếp mảng tăng dần.

Input Format

Dòng 1: Số nguyên n.
Dòng 2: n số nguyên.

Constraints

1 ≤ n ≤ 500
1 ≤ arr[i] ≤ 10^4

Sample Input

6
5 2 4 6 1 3

Sample Output

1 2 3 4 5 6