what are the advantage and disadvantage of recursion
Answer Posted / 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 |
Post New Answer View All Answers
What is a double c?
Is malloc memset faster than calloc?
How many main () function we can have in a project?
What is zero based addressing?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
a program that can input number of records and can view it again the record
What are the complete rules for header file searching?
Is c# a good language?
Explain what are global variables and explain how do you declare them?
What is meant by errors and debugging?
What is the difference between new and malloc functions?
What are operators in c?
What is the purpose of void pointer?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
Why isn't any of this standardized in c? Any real program has to do some of these things.