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

  Cs433: computer architecture

CS433: Computer Architecture - Spring  2014,  Assume a new execution mode called "enhanced mode" provides a 1.5x speedup to the sections of programs where it applies. What percentage of a program (measured by original execution time) must run in en..

  What are the drawbacks of your changes?

Describe what changes could be made to an operating to break the conditions of non-preemption and hold and wait for deadlock prevention. What are the drawbacks of your changes?

  How many instructions can be executed during waiting period

f the machine is capable of executing ten instructions each microsecond, how many instructions can be executed during this waiting period? Show the details of all calculations.

  Section on access controls

Refer to the section on Access Controls. What is the difference between "authorization" and "authentication"? What do we use to perform each of these access control functions? What are the advantages and limitations of the different approaches?

  Explain main resources in management information systems

The three main resources in management information systems (MIS) are information, information technology, and people. Which of these three resources is the most significant?

  How verbal and nonverbal communication affect communication

Write 1,750- to 2,100-word paper explaining how verbal and nonverbal communication can affect communication in given areas: Police situations (public announcement to the press).

  Create the data model segment for business rules

The FlyRight Aircraft Maintenance (FRAM) division of FlyRight Company (FRC) does all maintenance for FRC's aircraft. Create the data model segment which reflects the following business rules.

  What is the goal of information systems planning?

What is the goal of information systems planning? What are the steps of the traditional systems development life cycle? What is prototyping? What is an RFP? What is typically included in one? How is it used?

  Runnig test cases on same piece of code

Why four people must waste their time looking for faults when one person can run test cases on same piece of code. How do you respond?

  How many instructions executed in single time slice

Machine executed average of 5000 instructions per microseconds. How many instructions could be executed in a single time slice?

  Policies and provisions to unbundled network elements

What are some of the major policies and provisions under the 1996 Act in regards to unbundled network elements (UNEs).

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

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