Jump to content

Sorting algorithms/Bubble sort: Difference between revisions

m
(Better implementation)
Line 4,101:
{ (vector number) --> (vector number) }
A -> (let N (limit A)
(bubble-h (one-pass A N false 2) A N)))</lang>
 
<lang shen>(datatype some-globals
 
__________
Line 4,113:
(vector-> (value *arr*) 3 4)
(vector-> (value *arr*) 4 2)
(vector-> (value *arr*) 5 8)</lang>
<lang shen>(bubble-sort (value *arr*))</lang>
 
<lang shen>(bubble-sort (value *arr*))</lang>
 
Here is a more idiomatic implementation:
37

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.