Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Information Technology > Programming Languages > Data Structures

Data Structures Data Structures Interview Questions, Learn by sharing Data Structures Interview Questions asked in various Companies, Get Career advices, Interview Procedures from Data Structures experts, Post asked Data Structures Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-31-2008, 09:36 AM
Senior Member
 
Join Date: Feb 2008
Posts: 9,095
Default What is recursion

What is recursion?
Reply With Quote
  #2 (permalink)  
Old 04-25-2008, 03:03 PM
Junior Member
 
Join Date: Apr 2008
Posts: 17
Thumbs up

Recursion is the self-invocation of a function. If a function calls itself, it is a recursive function. Every function that uses iteration can be rewritten by using recursion. However there are few problems that are well suited for recursion, viz., factorial, Akermann function, binary search, quick sort, towers of hanoi, and so on. Use of recursion reduces the code size. But, to understand it, one needs to draw a tree depicting the order of function calls and traverse it in depth first fashion. There are several types of recursion: linear recursion, non-linear recursion and tail recursion. A fascinating concept indeed!!
Reply With Quote
Reply

Tags
data structures, interview questions

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On