Question: Define a function sort which accepts only a numeric comparison predicate and a list of numbers as arguments, in that order, and returns the list

Define a function sort which accepts only a numeric comparison predicate and a list of numbers as arguments, in that order, and returns the list of numbers sorted by the predicate. Follow Design Guidelines Four, Five, and Six completely. A > (sort (sort '(3)) 5 (3) 6 7 > (sort (sort (sort (sort > '()) 17 () 18 19 > (sort > '(1)) 20 (1) 21 22 > (sort > '(1 2)) 23 (2 1) 24 25 > (sort > '(1 2 3)) 26 (3 2 1) 27 28 > (sort > '(1 2 3 4 5 6 7 8 9)) 29 (9 8 7 6 5 4 3 2 1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
