[plt-scheme] Htdp chapter 12 insertion sort

aditya shukla adityashukla1983 at gmail.com
Tue Jun 2 01:54:57 EDT 2009


I have a question about the insertion sort algorithm implemented in chapter
12.The figure 33 explains

;; sort : list-of-numbers  ->  list-of-numbers (sorted)
;; to create a list of numbers with the same numbers as
;; alon sorted in descending order
(define (sort alon)
  (cond
    [(empty? alon) empty]
    [(cons? alon) (insert (first alon) (sort (rest alon)))]))- what is
cons? alon here , is it required there?


Thanks

Aditya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090602/2e8ef0a2/attachment.html


More information about the plt-scheme mailing list