Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Scheme program for each of the following. You can use the linprog server for your implementation - it has Scheme installed in

 

Write a Scheme program for each of the following. You can use the "linprog" server for your implementation - it has Scheme installed in it. a) To reverse a list. You are not allowed to use the built-in function "reverse". Input to the program is a list. Print the final list. For instance, Ist = (5 11 22 3) output: (3 22 11 5) (5 points) b) To insert an element "a" in a sorted list "Ist" (sorted in ascending order), such that the resulting list is still sorted. Input to the program are "a" and "Ist". Print the final list. For instance, 1st (14 7 12 19) and a = 6, output: (1467 12 19) (5 points) c) To check if an item "a" is present in a list "Ist". The program should return "#t" if the item is present and "#f" otherwise. Input to the program are "a" and "Ist". For instance, 1st (6 22 3 7 8) and a = 3 output: #t 1st (6 22 3 7 8) and a = 9 output: #f (5 points) d) Which takes in two lists "Ist 1" and "Ist2", both of which are individually sorted (in ascending order), and returns a list containing the elements of both Ist1 and 1st2 in sorted order. Print the final list. Input to the program are "Ist 1" and "Ist2". For instance, 1st 1 (1357) and 1st2 = (2468) output: (12345678) (5 points)

Step by Step Solution

3.53 Rating (146 Votes )

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

Business Communication Essentials a skill based approach

Authors: Courtland L. Bovee, John V. Thill

6th edition

978-0132971324

More Books

Students also viewed these Programming questions

Question

What is the AIDA model, and what are its limitations?

Answered: 1 week ago

Question

Define ethics and explain what ethical communication encompasses.

Answered: 1 week ago