Question: Quicksort in LISP using random numbers and the command line Need help with modifying the code below to generate a random list of numbers and

Quicksort in LISP using random numbers and the command line

Quicksort in LISP using random numbers and the command line Need help

with modifying the code below to generate a random list of numbers

Need help with modifying the code below to generate a random list of numbers and a specified number max from command line, and then sort the lst.

(defun qsort (L)

(cond

((null L) nil)

(t

(append

(qsort (list

(cons (car L) nil)

(qsort (list>= (car L) (cdr L)))))))

(defun list

(cond

((or (null a) (null b)) nil)

((

(t (cons (car b) (list

(defun list>= (a b)

(cond

((or (null a) (null b)) nil)

((>= a (car b)) (list>= a (cdr b)))

(t (cons (car b) (list>= a (cdr b))))))

Task Write a Lisp program that generates a list of n random numbers, sorts them using Quicksort, and prints out the sorted ist to the screen. Task Write a Lisp program that generates a list of n random numbers, sorts them using Quicksort, and prints out the sorted ist to the screen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!