Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -0,0 +1,14 @@
|
|||
fn inSort arr =
|
||||
(
|
||||
arr = deepcopy arr
|
||||
for i = 1 to arr.count do
|
||||
(
|
||||
j = i
|
||||
while j > 1 and arr[j-1] > arr[j] do
|
||||
(
|
||||
swap arr[j] arr[j-1]
|
||||
j -= 1
|
||||
)
|
||||
)
|
||||
return arr
|
||||
)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
b = for i in 1 to 20 collect random 1 40
|
||||
#(2, 28, 35, 31, 27, 24, 2, 22, 15, 34, 9, 10, 22, 40, 26, 5, 23, 6, 18, 33)
|
||||
a = insort b
|
||||
#(2, 2, 5, 6, 9, 10, 15, 18, 22, 22, 23, 24, 26, 27, 28, 31, 33, 34, 35, 40)
|
||||
Loading…
Add table
Add a link
Reference in a new issue