Question: LISP Programming Language Write a Bubble Sort program in the LISP Programming Language called sort that sorts the array below in ascending order. LISP is

LISP Programming Language

Write a Bubble Sort program in the LISP Programming Language called sort that sorts the array below in ascending order. LISP is a recursive language so the program will use recursion to sort. Since there will be no loops, you will not need the variables i, j, and temp, but still use the variable name array for the array to be sorted.

Array to be sorted is 34, 56, 4, 10, 77, 51, 93, 30, 5, 52

The program should:

  1. Invoke your LISP sort function by (sort '(34 56 4 10 77 51 93 30 5 52))
  2. Use the Bubble Sort Algorithm to sort the array in ascending order
  3. LISP will automatically display the array when the sort function completes

The output should look like the following:

Welcome to DrRacket, version 5.3.4 [3m].

Language: racket; memory limit: 128 MB.

'(4 5 10 30 34 51 52 56 77 93)

>

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!