Sorting algorithms/Bubble sort: Difference between revisions
Content added Content deleted
m (→{{header|JavaScript}}: (Pruning redundant whitespace)) |
ReeceGoding (talk | contribs) m (→{{header|R}}: Syntax highlighting.) |
||
Line 5,020: | Line 5,020: | ||
=={{header|R}}== |
=={{header|R}}== |
||
The previously solution missed out on a cool R trick for swapping items and had no check for lists of length 1. As R is 1-indexed, we have aimed to be as faithful as we can to the given pseudo-code. |
The previously solution missed out on a cool R trick for swapping items and had no check for lists of length 1. As R is 1-indexed, we have aimed to be as faithful as we can to the given pseudo-code. |
||
<lang |
<lang rsplus>bubbleSort<-function(items) |
||
{ |
{ |
||
repeat |
repeat |