Lec37 - Computer Programming I TA C162 To be discussed...

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

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 . 19 Apr 2007 To be discussed today….. Recursive functions Definition Examples
Image of page 1

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

View Full Document Right Arrow Icon
2 Computer Programming I TA C162 . 19 Apr 2007 Definition (Mathematical) Recursion is the process of defining something in terms of  itself, and is sometimes called  circular definition . A recursive process is one in which objects are defined in  terms of other objects of the same type. Using some sort of  recurrence relation. The entire class of objects can then be built up from a few  initial values and a small number of rules.  Ex: Fibonacci  Number series
Image of page 2
3 Computer Programming I TA C162 . 19 Apr 2007 Definition (Computer Science) A recursive function is one which calls itself.  Recursive functions are useful in evaluating certain types of  mathematical function.  When a function calls another function and that second  function calls the third function then this kind of a function is  called  nesting  of functions.  But a recursive function is the function that calls itself  repeatedly. 
Image of page 3

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

View Full Document Right Arrow Icon
4 Computer Programming I TA C162 . 19 Apr 2007 Simple example main() { printf(“This is an example of recursive function”); main(); } When this program is executed. The line is printed repeatedly  and indefinitely. We might have to abruptly terminate the  execution. 
Image of page 4
5 Computer Programming I TA C162 .
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