Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
# v0.6
|
||||
|
||||
function insertionsort!(A::Array{T}) where T <: Number
|
||||
for i in 1:length(A)-1
|
||||
value = A[i+1]
|
||||
j = i
|
||||
while j > 0 && A[j] > value
|
||||
A[j+1] = A[j]
|
||||
j -= 1
|
||||
end
|
||||
A[j+1] = value
|
||||
end
|
||||
return A
|
||||
end
|
||||
|
||||
x = randn(5)
|
||||
@show x insertionsort!(x)
|
||||
Loading…
Add table
Add a link
Reference in a new issue