diff options
| author | Paul Buetow <paul@buetow.org> | 2023-04-02 20:22:13 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-04-02 20:22:13 +0300 |
| commit | 0c6d4ed2e499e3e17165e43803d0d1c6dd0956d9 (patch) | |
| tree | 6d6a5df53d1dd3e655d24f0423f24bc52ad9784c /sort/insertion.go | |
| parent | f78ba2cdc6840dbc52a27a2f9fac28f3b61e8b7b (diff) | |
initial generics
Diffstat (limited to 'sort/insertion.go')
| -rw-r--r-- | sort/insertion.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sort/insertion.go b/sort/insertion.go index 62dcf32..a6b3c85 100644 --- a/sort/insertion.go +++ b/sort/insertion.go @@ -4,7 +4,7 @@ import ( "codeberg.org/snonux/algorithms/ds" ) -func Insertion(a ds.ArrayList) ds.ArrayList { +func Insertion[V ds.Number](a ds.ArrayList[V]) ds.ArrayList[V] { for i, _ := range a { for j := i; j > 0; j-- { if a[j] > a[j-1] { |
