Sorting algorithms/Bubble sort: Difference between revisions
Content added Content deleted
m (→{{header|J}}) |
m (J code brought closer to the specification) |
||
Line 570: | Line 570: | ||
=={{header|J}}== |
=={{header|J}}== |
||
<lang J> |
<lang J> |
||
bubbleSort=: |. @: ((([ (>. , <.) {.@]) , }.@])/^:_) |
|||
</lang> |
</lang> |
||
Line 579: | Line 579: | ||
4 6 8 6 5 8 6 6 6 9 |
4 6 8 6 5 8 6 6 6 9 |
||
bubbleSort ?. 10 $ 10 |
bubbleSort ?. 10 $ 10 |
||
4 5 6 6 6 6 6 8 8 9 |
|||
</lang> |
</lang> |
||