;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname sorting) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp"))))) ;; Functions implement insertion sort, see Ch. 12 ;; insert : number, list-of-numbers -> list-of-numbers ;; Assumption: the given list of numbers is already sorted ;; in descending order ;; Creates a list of numbers from n and the numbers in alon ;; that is sorted in descending order ;; Example: ;; (insert 5 (list 7 6 2 1)) -> (7 6 5 2 1) (define (insert n alon) ) ;; Tests: ;; sort : list-of-numbers -> list-of-numbers ;; Creates a list of numbers that has all elements from the given ;; list of numbers, but in descending order ;; Example: ;; (sort (list 4 2 7 1 6)) -> (list 7 6 4 2 1) ;(define (sort alon) ;)