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
Exception handling Exception handling is a mechanism that separates code that detects and handles exceptional circumstances from the rest of your program. Note that an exceptional

Return a new picture with each pixel''s color values made up of 80% of the color values of the corresponding pixel in the first picture and 20% of the color values of the

develop a pseudocode algorithm to determine the total amount of extra cost changed to the organizers for expenses accurednduring the workshop. the code is to be written for an unde

analyse the information need in the different functional area in any organization

Write a program to display some data in bar graph form. Have at least 20 elements, which can be positive or negative; draw each element with a vertical bar, going up if the data is

Write a detailed description on how you would go about planning information system for an organisation

The fancy new French restaurant La Food is very popular for its authentic cuisine and high prices. This restaurant does not take reservations. To help improve the efficiency of t

Need help with a cobol program.

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

Define the If - else statement - computer programming? The If - else statement The universal form of if - else statement is                         if(expression)