Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (10 sloc) 228 Bytes
sub insertion-sort(@data) {
@data.splice(
@data.first(* >= @data[$_], :k),
0,
@data.splice($_, 1)
) for ^@data;
}
my @data = 4, 5, 7, 1, 46, 78, 2, 2, 1, 9, 10;
insertion-sort @data;
say @data;
You can’t perform that action at this time.