To program using the functional programming paradigm

Assignment Help Data Structure & Algorithms
Reference no: EM13333263

Objective:

• To program using the functional programming paradigm.

Assignment:

Write the following functions using Scheme (or LISP if you prefer):

1. A function (binomial N k) that returns the binomial coefficients C(N, k), defined recursively as: C(N,0) = 1, C(N, N) = 1, and, for 0<k < N, C(N, k) = C(N-1, k) + C(N - 1, k -1).
2. A function (mod N M) that returns the modulus remainder when dividing N by M.
3. A function (binaryToDecimal b) that takes a binary number and returns its decimal value. (binaryToDecimal 1101) returns 13.
4. A function (addBinary binaryList) that takes a list of binary numbers and returns their decimal sum. (addBinary '(1101 111 10 101)) returns 27
5. A function (min list) that returns the smallest value in a simple list of integers.
6. A function (myRemove atm list) that removes all occurrences of the atom atm from a simple list, returning list with atm removed. myRemove should return the original list if atm is not found.
7. A function (selectionSort list) that returns a simple list of integers in ascending order using a recursive selection sort algorithm. Hint: use your min function.
All the functions must be written in a functional style and must use only the basic LISP functions car, cdr, cons, null, atom, the equality functions, the arithmetic functions, and the append function.

Reference no: EM13333263

Questions Cloud

How much force is pushing the cart in the forward direction : a shopper pushes a grocery cart by exerting a force on the handle. if the force equal 76 N at an angle of 40.0 degrees below the horizontal, how much force is pushing the cart in the forward direction
Explain why long-distance phone service was orginally : For many years, AT&T was a regulated monopoly, providing both local and long-distance telephone service.Explain why long-distance phone service was orginally a natural monopoly.
What is the lenght of the electrons angular momentum vector : An electron is in an angular momentum state with l=3, What is the lenght of the electron's angular momentum vector
Evaluate the ph of an koh solution : Calculate the pH of an KOH solution if 56.4 mL of KOH soultion is titrated with a 0.875 M HCl and it took 15.6 mL of the HCl to reach the equivalence point.
To program using the functional programming paradigm : A function (addBinary binaryList) that takes a list of binary numbers and returns their decimal sum. (addBinary '(1101 111 10 101)) returns 27.
Evaluate direct labor cost and manufacturing overhead : What are the equivalent units for conversion costs for the month in the first processing department and the allocation of Becky's wages and fringe benefits for the week between direct labor cost and manufacturing overhead would be
Determine the friction force acting on the block : A 2.90-kg block starts from rest at the top of a 30.0° incline and slides a distance of 2.10 m down the incline in 1.20 s. Find the friction force acting on the block
Define what is the percent yield of the product : For the reaction: Rb2SO3(s) + 2HBr(aq) --> 2RbBr(s) + H2SO3 A solid sample of Rb2SO3 weighing 6.24 g reacts with 1.38 L of gaseous HBr, measured at 75°C and 0.953 atm pressure
Find the magnitude of the total gravitational force : Four 8.5 kg spheres are located at the corners of a square of side 0.80 m. Calculate the magnitude and direction of the total gravitational force

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd