Alphebetizing Lists in Scheme
Name:
Anonymous
2012-10-24 2:06
Anyone have an idea on how I could do this?
Name:
Anonymous
2012-10-24 2:11
Fuck scheme, use a real language, like C.
Name:
Anonymous
2012-10-24 2:16
Yeah Scheme is shit tier.
Name:
Anonymous
2012-10-24 2:17
Make a helper function to alphabetize, then a main function.
Name:
Anonymous
2012-10-24 2:27
WTF is "Alphebetizing Lists"? Is it like finger trees a new advanced data structure to implement list, where every operation is O(1)?
Name:
Anonymous
2012-10-24 2:30
>>5
Basically want I want to do is:
Lets say I had a list of countries:
America
Canada
Berlin
France
Mexico
Italy
I need to organize that list to go in alphabetical order like so:
America
Berlin
Canada
France
Italy
Mexico
Name:
Anonymous
2012-10-24 2:35
>>6
Just use a binary tree for that.
Name:
Anonymous
2012-10-24 2:51
Bump
Name:
Anonymous
2012-10-24 3:07
sort' :: Ord a => [a] -> [a]
sort' [] = []
sort' (x:xs) = (sort' (filter (<x) xs)) : x : (sort' (filter (>=x) xs))
Name:
Anonymous
2012-10-24 3:23
Name:
Anonymous
2012-10-24 3:33
Symta:
qsort [H@T] =l @(k f ?≤H T|r) H @(k f ?≥≥H T|r)
Haskell:
sort' :: Ord a => [a] -> [a]
sort' [] = []
sort' (x:xs) = (sort' (filter (<x) xs)) : x : (sort' (filter (>=x) xs))
Name:
Anonymous
2012-10-24 5:34
BASIC:
qsort(x)
Symta:
qsort [H@T] =l @(k f ?≤H T|r) H @(k f ?≥≥H T|r)