Write a version of sum pairs i that sums each component

Assignment Help Basic Computer Science
Reference no: EM13163238

Using SML write a version of sumPairs that sums each component of the pairs separately, returning a pair consisting of the sumof the first components and the sum of the second components

 

fun sumPairs(nil) = 0

| sumPairs((x,y)::zs) = x + y + sumPairs(zs);

 

val sumPairs = fn : (int * int) list -> int

 

 

Reference no: EM13163238

Questions Cloud

Client-professional relationship-meat and potatoes : Assessment and goal setting are the "meat and potatoes" of the professional interview. In addition, assessments help both the professional and the client identify goals to work toward in the client-professional relationship.
Write a function that takes a list of integers : Using ML write a function that takes a list of integers as argument and returns a pair consisting of the sum of the even position and the sum of the odd positions of the list.
What is the composition of the mixture by volume : A gas mixture composed of helium and argon has a density of 0.853g/L at a 745mmHg and 298K .What is the composition of the mixture by volume?
What will be the volume of the gas sample : A gas sample has an original volume of 760 ml when collected at 720 mm and 25degC. What will be the volume of the gas sample if the pressure increases to 820 mm and the temperature increases to 30degC?
Write a version of sum pairs i that sums each component : Using SML write a version of sumPairs that sums each component of the pairs separately, returning a pair consisting of the sumof the first components and the sum of the second components
What is a triple point : Carbon tetrachloride, CCl4, is nonpolar. What forces hold the molecules together?
Calculate the actual neutralizing capacity of the antacid : If 0.500 g of antacid was added to 50.00 mL of 0.100 M HCL and 5.65 mL of 0.100 M NaOH was required to titrate the un-neutralized HCL, calculate the actual neutralizing capacity of the antacid in mmol H+ per gram.
Determine the keq for the reaction of benzoic acid : The pKa's of benzoic acid and 4-nitroanilinium hydrochloride are 4.2 and 1.0, respectively.
What is the vapor pressure of water : The vapor pressure of water at 20oC is 17.5 mmHg. What is the vapor pressure of water (in mmHg) over a solution prepared from 258 g sucrose (C12H22O11) and 350 g water?

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  Benefits-negative effects brought by workplace automation

Write down at least three benefits and three negative effects brought about by workplace automation.

  Function in programs to print upside down triangles

Apply function in programs to prints triangles, upside down triangles, and diamond.

  Virtual and physical addresses

The page table shown in Figure 9.32 is for a system with 16-bit virtual and physical addresses and with 4,096-byte pages. The reference bit is set to 1 when the page has been referenced. Periodically, a thread zeroes out all values of the reference b..

  What is optimal strategy if n is known

Consider the numerical 20 questions game. In this game, player 1 thinks of a number in the range 1 to n. Player 2 What is an optimal strategy if n in known?

  Significant difference of typical salary for system analyst

Is there a significant difference between typical salaries for system analyst, designers, and developers? What is the difference between typical salaries for these different groups?

  Identify system operation and section of it shop

Write down the four major support activities you require to be aware of, and what is critical requirement for each of these activities.

  Give examples of 3 simple (scalar or primitive) data types

Give examples of 3 simple (scalar or primitive) data types commonly provided by programming languages, and identify the method used to represent each data type in the machine

  The poisson distribution with parameter ramda?

a) the "distribution" where N is the same fixed number with probability 1?b) the Poisson distribution with parameter ramda?

  Explaining actionscript developer

What do you believe the following comment means for ActionScript developer: "you are used to having to define object methods and properties in class structure before using them in instance.

  Distinguish distances that moved their shopping carts

Performing 200 Nm of work. Both Brian and Dawn are exerting same amount of force (20 N). Distinguish the distances that Brian and Dawn moved their shopping carts.

  Business reprocess engineering-strategic information system

Some people may say that Business Reprocess Engineering (BPR) is special case of strategic information system, whereas, others may say opposite is true. Describe this statement in scholarly detail.

  Write strategies for personnel of security organization

Write down 1,400- to 2,100-word paper in which you write strategies for personnel of security organization. The main factors in work environment which should be addressed in new department

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