Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,9 +1,9 @@
import std.stdio, std.algorithm, std.range, std.array;
auto quickSort(T)(T[] items) /*pure*/ nothrow {
auto quickSort(T)(T[] items) pure nothrow @safe {
if (items.length < 2)
return items;
auto pivot = items[0];
immutable pivot = items[0];
return items[1 .. $].filter!(x => x < pivot).array.quickSort ~
pivot ~
items[1 .. $].filter!(x => x >= pivot).array.quickSort;

View file

@ -1,6 +1,6 @@
import std.stdio, std.algorithm;
void quickSort(T)(T[] items) pure nothrow {
void quickSort(T)(T[] items) pure nothrow @safe @nogc {
if (items.length >= 2) {
auto parts = partition3(items, items[$ / 2]);
parts[0].quickSort;