Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

Question How are IRAs treated for state tax law purposes?

Answered: 1 week ago