Starter project: add stable sort to the standard library


(Dmitri Gribenko) #1

Hi,

The standard library should provide a stable sort. This needs a
proposal to swift-evolution (the design should be trivial, new methods
should mirror existing sorting APIs), and implementation. The
standard library already contains an internal implementation of
insertion sort, so implementing this should amount to providing public
entry points and writing tests.

https://bugs.swift.org/browse/SR-306

Dmitri

···

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/