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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight 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
Background 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. 
Background image of page 3

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

View Full DocumentRight 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. 
Background image of page 4
5 Computer Programming I TA C162 . 19 Apr 2007
Background image of page 5

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

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

This note was uploaded on 05/07/2010 for the course CS&IS TA C162 taught by Professor Kavitha during the Spring '09 term at Birla Institute of Technology & Science.

Page1 / 16

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

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online