tutorial06 - CS 135 Winter 2012 Tutorial the Sixth CS 135...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 135 - Winter 2012 Tutorial the Sixth February 15, 2012 CS 135 Winter 2012 06: Tutorial the Sixth 1
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Clicker Question - type of recursion ( define ( foo a b ) ( cond [( zero? a ) b ] [ else ( foo ( sub1 a ) ( cons " foo " b ))])) ( foo 19 empty ) What kind of function is this? A Pure structural recursion B Structural recursion with an accumulator C Generative recursion D Non-recursive E Recursion of another type CS 135 Winter 2012 06: Tutorial the Sixth 2
Image of page 2
Clicker Question - Recursion What type of recursion is used in the following function? ( define ( fn1 a ) ( fn2 a 1 0 )) ( define ( fn2 a b c ) ( cond [( zero? a ) c ] [ else ( fn2 ( sub1 a ) b ( + b c ))])) A Pure Structural Recursion B Accumulative Recursion C Generative Recursion CS 135 Winter 2012 06: Tutorial the Sixth 3
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Clicker Question - Recursion What type of recursion is used in the following function? ( define ( fn3 a ) ( cond [( = 1 a ) ( cons 1 empty )] [( even? a ) ( cons a ( fn3 ( / a 2 )))] [ else ( cons a ( fn3 ( + 1 ( * 3 a ))))])) A Pure Structural Recursion B Accumulative Recursion C Generative Recursion CS 135 Winter 2012 06: Tutorial the Sixth 4
Image of page 4
Clicker Question - Recursion What type of recursion is used in the following function?
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern