diff options
author | Jed Barber <jjbarber@y7mail.com> | 2015-10-17 14:20:48 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2015-10-17 14:20:48 +1100 |
commit | 63c3043200de6b28a8c192f1b5625940435ea55e (patch) | |
tree | ab761edbbc71b2b2f28e0ef7e10b8adc58d44320 /insertion.adb | |
parent | 5933f248c18914fbbce03102b340361a575eae3c (diff) |
Organised source code a bit, added makefile with clean target
Diffstat (limited to 'insertion.adb')
-rw-r--r-- | insertion.adb | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/insertion.adb b/insertion.adb deleted file mode 100644 index 863fb8e..0000000 --- a/insertion.adb +++ /dev/null @@ -1,29 +0,0 @@ - - -package body Insertion is - - - procedure Sort(Arr : in out Array_T) is - Place : Index_T; - Temp : Element_T; - begin - if Arr'Length <= 1 then - return; - end if; - - for I in Index_T range Index_T'Succ(Arr'First) .. Arr'Last loop - if Arr(Index_T'Pred(I)) > Arr(I) then - Place := I; - while Place /= Arr'First and then Arr(Index_T'Pred(Place)) > Arr(I) loop - Place := Index_T'Pred(Place); - end loop; - Temp := Arr(I); - Arr(Index_T'Succ(Place) .. I) := Arr(Place .. Index_T'Pred(I)); - Arr(Place) := Temp; - end if; - end loop; - end Sort; - - -end Insertion; - |