08-13-2017, 08:24 PM
(This post was last modified: 08-13-2017, 08:30 PM by davidmccoy.)

Quote:4. TQ: What kind of process does the following function implement?

Code:`(define (f x y z)`

(cond

((= x 0) (* y z))

((< x 5) (f y z (+ x 7))

((< x 10) (+ y (* 2 z) (f (- x 1) y z)))

(else x)

)

)

This is a real piece of work. If I put in any x 10 or greater, I just get back x. If x is less than 10 I do I weird combinations of jumping between an expression that looks tail recursive and an expression that looks non-tail recursive. What's going on here?

*Also, does *TQ* stand for *Tough Question*?

UA ACM Vice President

ACM has bi-weekly meetings Tuesdays at 5:15pm

We're UA's best organization for CS majors (website)

Join us on Slack for all kinds of discussion channels (including one for CS403)

ACM has bi-weekly meetings Tuesdays at 5:15pm

We're UA's best organization for CS majors (website)

Join us on Slack for all kinds of discussion channels (including one for CS403)