September 2010
M T W T F S S
« Dec    
 12345
6789101112
13141516171819
20212223242526
27282930  

Categories

Sorting Algorithms in Scheme

I will talk about three distinct sorting algorithms. Perhaps, the easiest to implement is the quicksort.
In short, it sorts the input by positioning the input around the first element(pivot) and recursively sorts thepartitions. Here is the implementation:

?View Code SCHEME1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;;;;;;QUICKSORT;;;;;;;;
 
;myquicksort: listOfNumbers->listOfNumbers
; Sorts the input by positioning the input around the first element(pivot) and recursively sorts the [...]