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

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

1 Computer Programming I TA C162 . 19 Apr 2007 To be discussed today….. Recursive functions Definition Examples

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

View Full Document
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
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.

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

View Full Document
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.
5 Computer Programming I TA C162 .

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern