Determine that the processes are iterative or recursive, Programming Languages

Each of the following two procedures defines a method for adding two positive integers in  terms of the procedures inc, which increments its argument by 1, and dec, which decrements its argument by 1:

(define (plus1 a b)

(if (= a 0)

b

(inc (plus1 (dec a) b))))

(define (plus2 a b)

(if (= a 0)

b

(plus2 (dec a) (inc b))))
 
Using the substitution model, illustrate the process generated by each procedure in evaluating (+ 2 5). Are these processes iterative or recursive?

Posted Date: 3/22/2013 5:11:24 AM | Location : United States







Related Discussions:- Determine that the processes are iterative or recursive, Assignment Help, Ask Question on Determine that the processes are iterative or recursive, Get Answer, Expert's Help, Determine that the processes are iterative or recursive Discussions

Write discussion on Determine that the processes are iterative or recursive
Your posts are moderated
Related Questions
JavaScript is "Object Oriented" like C++ or Java. (Note that Java and JavaScript are not the same language, which is a common misconception) It also has variables, which makes Java

program the following exercises using JAVA and JENA API: SPARQL endpoint to be queried: QUERY:">http://services.data.gov.uk/education/sparql QUERY: What are the school’s names th

i have a database having field name title and comm. I want to search by name and get the all data remaining title and comm(comm is integer)

1.   You have been asked to write a computer program that will figure out the total of an order when given the amount of the order ($200) and a sales tax rate of five percent.  I w

Write a script called 'prob2.m' that asks the user if they wish to clear the variables in the workspace. If the user responds with the strings 'y' or 'yes' then the workspace shoul

want to do an image-mean. but image is and mean is so an error showing Error using ==> minus Number of array dimensions must match for binary array op. wat to do?

Question: (a) (i) Describe what an XML Data Island is and outline the restrictions of using a Data Island. (ii) The following XML file book.xml is used to keep track of a l

EF308 Assignment 2 Due: 3pm, 26 April 2012 Introduction This assignment is loosely based on Cheung et al. (2005) and Molodtsova and Papell (2009) and examines the out-of- sample pr

Consider the following schema (DTD) and sample instance document: name    ID      #REQUIRED spouse  IDREF   #IMPLIED job     CDATA   #IMPLIED > ]>

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4