Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what are the advantage and disadvantage of recursion

Answers were Sorted based on User's Feedback



what are the advantage and disadvantage of recursion..

Answer / vadivelt

Recursion will be useful when same kind of job has to be
continued for a finite no input or time.

Eg: calculating series, finding factorial etc..

Disadvantage would be,
1.Hard to analyse or understand the code.
2.If the recursive function is called for infinite no of
times and memory constrains are not taken care, then stack
overflow may occur So system may crash.

Is This Answer Correct ?    52 Yes 7 No

what are the advantage and disadvantage of recursion..

Answer / vasu jain

Recursion
Advantage
i. Usually simplicity.
ii. Although at most of the times a problem can be solved without recursion, but in some situations in programming, it is a must to use recursion. For example, a program to display a list of all files of the system cannot be solved without recursion.
iii. The recursion is very flexible in data structure like stacks, queues, linked list and quick sort.
iv. Using recursion, the length of the program can be reduced.
Disadvantage
i. It requires extra storage space. The recursive calls and automatic variables are stored on the stack. For every recursive calls separate memory is allocated to automatic variables with the same name.
ii. Often the algorithm may require large amounts of memory if the depth of the recursion is very large. If the programmer forgets to specify the exit condition in the recursive function, the program will execute out of memory.
iii. The recursion function is not efficient in execution speed and time.
iv. Some function calls inside recursion are repeated or duplicated just like fibonacci

Is This Answer Correct ?    47 Yes 5 No

what are the advantage and disadvantage of recursion..

Answer / suman boddukuru

Advantage : Perform an action untill a condition
satisfies,Also for the repetative calls for inputting and
etc.
Disadvantage: If it encounters the infinite looping then
the stack overflow occurs it will cause ssem crash...

Is This Answer Correct ?    32 Yes 8 No

what are the advantage and disadvantage of recursion..

Answer / satyabrata nayak

Recursion will be useful when same kind of job has to be
continued for a finite no input or time.

Eg: calculating series, finding factorial etc..

Disadvantage would be,
1.Hard to analyse or understand the code.
2.If the recursive function is called for infinite no of
times and memory constrains are not taken care, then stack
overflow may occur So system may crash.

Is This Answer Correct ?    23 Yes 6 No

what are the advantage and disadvantage of recursion..

Answer / jyoti singh

Advantages of recursion:-
1.Recursion is more efficient if the program using recursion is run on computer with multiprocessing facilities.
2.It is very useful in solving the data structure problems.
3. It is easily, simple and understandable.

Disadvantages of recursion:-
1. It requires more memory because recursive calls along with automatic variables are stored on the stack.
2.The computer may run out of memory if recursive calls are not properly checked.

Is This Answer Correct ?    15 Yes 0 No

Post New Answer

More C Interview Questions

Explain about the functions strcat() and strcmp()?

0 Answers  


what is the difference between structure and union?

3 Answers  


print ur name without using any semicolon in c/c++....

21 Answers   Bosch, TCS, Wipro,


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

0 Answers  


What is time null in c?

0 Answers  


write a program to find the given number is prime or not

2 Answers   Accenture, Vasutech,


When should a type cast be used?

0 Answers  


What are the properties of union in c?

0 Answers  


What are .h files and what should I put in them?

3 Answers  


Write a program in c using only loops to print * * * * * *******

2 Answers   IBM,


Can a variable be both constant and volatile?

0 Answers  


When is a “switch” statement preferable over an “if” statement?

0 Answers  


Categories