New answers tagged

0 votes

Bubble Sort as extension to Swift-Arrays

The existing sort functions in the Swift standard library come in two flavors: A mutating method sort() which sorts a collection in-place and does not return a ...
Martin R's user avatar
  • 23k
1 vote
Accepted

Bubble Sort as extension to Swift-Arrays

One natural modification I'd consider an improvement is the use of for for the inner loop. I think it more direct to let the outer control variable (...
greybeard's user avatar
  • 5,954

Top 50 recent answers are included