Insertion sort

Write a procedure that sorts @v@ in non-decreasing order using the
insertion sort algorithm.

Interface

+-------:+:--------------------------------------------------+
| C++    |     void insertion_sort(vector<double>& v);       |
+--------+---------------------------------------------------+
| C      |     void insertion_sort(int n, double v[n]);      |
+--------+---------------------------------------------------+
| Java   |     public static void insertionSort(double[] v); |
+--------+---------------------------------------------------+
| Python |     insertion_sort(v)  # returns None             |
+--------+---------------------------------------------------+
| MyPy   |     insertion_sort(v: list[float]) -> None        |
+--------+---------------------------------------------------+

Observation

You only need to submit the required procedure; your main program will
be ignored.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:05:48.513Z

© Jutge.org, 2006–2026.
https://jutge.org
