Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

§ /prog/ Challenge #32767 §

Name: Anonymous 2011-05-10 16:42

The Challenge: Given a number k where k ≥ 2, print another program (in the language you solve this challenge) that performs an O(nk) sort on a list (in-place or not is for you to decide).

The Deadline: 2011/05/18, 00:00 UTC.

Name: >>1 2011-05-10 16:44

Errata: s/this challenge/& in/

Name: Anonymous 2011-05-10 16:45

That's not too hard really... so I'm not going to do it.

Name: Anonymous 2011-05-10 17:38

>>1
print another program (in the language you solve this challenge)
Unfair for non-Lispers.

Name: Anonymous 2011-05-10 18:13

The UTC

Name: Anonymous 2011-05-10 19:49

Would it be a good idea to complete one of these nutty challenges (in Java) and use that for a job application that requires a code sample?

Name: Anonymous 2011-05-10 21:45


let rec sortExprStr (k:int) (listExpr:string) =
    if k = 2 then
        "let rec qsort(xs : List<int>) =
                match xs with
                | [] -> []
                | x :: xs ->
                    let smaller = qsort (xs |> List.filter(fun e -> e <= x))
                    let larger = qsort (xs |> List.filter(fun e -> e >= x))
                    smaller @ [x] @ larger
           qsort %listExpr".Replace("%listExpr", listExpr)
    else
        let subSort = sortExprStr (k - 1) listExpr
        "%listExpr |> List.fold (fun acc n -> begin %subSort end) []".Replace("%listExpr", listExpr).Replace("%subSort", subSort)

System.Console.WriteLine(sortExprStr 10 "[3; 2; 1]")

Name: Anonymous 2011-05-10 21:56

>>7
<=
>=

Are you sure that it does work?

Name: Anonymous 2011-05-10 22:04

MORE LIKE
DO YOUR OWN HOMEWORK, BOZO
AMIRITE LOLLLLLLLLLLLLLLLLLLLLLLLZzz!!11oNE!!1ONE1!

Name: Anonymous 2011-05-10 22:13

>>8
Should be <= and > instead.  I copied and pasted it from a web site without checking it over.

Name: Anonymous 2013-01-19 22:17


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List