Using the substitution model illustrate the process, C/C++ Programming

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/28/2013 3:26:33 AM | Location : United States







Related Discussions:- Using the substitution model illustrate the process, Assignment Help, Ask Question on Using the substitution model illustrate the process, Get Answer, Expert's Help, Using the substitution model illustrate the process Discussions

Write discussion on Using the substitution model illustrate the process
Your posts are moderated
Related Questions
Describe spaghetti programming. - Spaghetti programming refers to codes which tend to get tangled and overlapped throughout the program. - It makes a program complex and ana

find largest clique present in graph

Passing and Returning Objects Objects can be passed to a function and returned back just like normal variables. When an object is passed by content, the compiler makes another

#include int main() { int T; int N; int i; scanf("%d",&T)


write a c++ code to implement use of a constructor

Literals (Constants) Constants are data storage locations whose address is not accessible for the user. Their value is not altered during the course of the program. Literal

Reusability  Reusability means reusing code written earlier, may be from some earlier project or from the library. Reusing old code not only saves development time, but also sa

program that decodes sending smuggler''s string

Greatest Common Divisor (GCD) - The greatest common divisor (GCD) of two integers is the largest integer that will evenly divide both integers. The GCD algorithm involves intege