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
write a program to sort the file sequential order and store on magnetic tape and print sorted tape as the output of the program.

Write your own version of the strcmp function string_compare. Supply a main program that will test each of the 3 differing outcomes. int string_compare(char *s, cha

Support for Multi-Targeting The multi-targeting function of Vision Facilities allows you specify the particular edition or account of the .NET Structure that is required for your p

I have assignment about python language . Could you helpe me to built it

Procedure-oriented programming (POP):- This is a top-down programming approach, where the problem is viewed as a sequence of tasks to be done such as calculating, printing etc. A n

Define a higher order version of the insertion sort algortihm. That is define functions insertBy :: Ord b => (a->b) -> a -> [a] -> [a] inssortBy :: Ord b => (a->b) -> [a] ->

If it is a weekday and it is not a holiday, then you go to work. However, if it is a weekday and it is a holiday, then what you do depends on the weather. If it is raining, you pla

Your program can be invoked with option: -d date, where date is entered in dd/mm/yyyy format. In this case, it must only print the following string: Found cookies expiring bef

Do you do APL programs ?

Figure is a representation of the solar system. In a basic model of the same concentric orbits planets rotate around the sun. The closer the Planet in less time Sun completes a ful