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
# include stdio.h> # include string.h> # include conio.h> void main() {           int i=0,j=0,b=0,count=0;           int a[100];           for(i=0;i

#write a program that counts the number of occurances of the string in the n-th padovan string p(n)

#include stdio.h> #include conio.h> #include string.h>   void del(char[],char *); main() {           char str[30],ch,*pp;           clrscr();           p

1) Database: The database needs to be used for persistent storage of cars. For details of what information should be stored in the database, please see the description above. You

Expected output of the program: 1. Consider the following programs. For each, indicate whether the program is correct. If yes, what is the expected output? If not, what is the

Define the Char Data Type of C Language? The char defines characters. The char type will usually require only 1 byte of internal storage. Every char type has an equivalent inte

Tell what the derived class inherits or doesn't inherit? A: Inherits: - All data member defined in the parent class (even though such members might not always be accessible

#question.gsdjfhjhjfkfk.

Based on the automobile's model year and weight, the city of Cebu determines the car's weight class and registration fee using the following schedule: Model Year Registration

The for Loop For loop is the controlled form of loop. The general format of this : for( initialize ; test ; update)                  {                     statements;