Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,23 @@
using System;
using System.Console;
using Nemerle.Collections.NList;
module Quicksort
{
Qsort[T] (x : list[T]) : list[T]
where T : IComparable
{
|[] => []
|x::xs => Qsort($[y|y in xs, (y.CompareTo(x) < 0)]) + [x] + Qsort($[y|y in xs, (y.CompareTo(x) > 0)])
}
Main() : void
{
def empty = [];
def single = [2];
def several = [2, 6, 1, 7, 3, 9, 4];
WriteLine(Qsort(empty));
WriteLine(Qsort(single));
WriteLine(Qsort(several));
}
}