CS101 GDB.1 Spring 2022


 


CS101

GDB.1 Spring 2022

Due Date: 02 – 09 – 2022

ANSWER

Recursion means "defining a problem in terms of itself". This can be a very powerful tool in writing algorithms. Recursion comes directly from Mathematics, where there are many examples of expressions written in terms of themselves. For example, the Fibonacci sequence is defined as: F(i) = F(i-1) + F(i-2)

According to the given scenario, in my opinion recursion is the best for the hospital to maintain patient record. Because recursion is a method of calling a function within the same function. Recursion is more retables as compared to loops. Recursion space complexity is higher than loops. Recursion has large amount of overhead as compared to loops.

 Recursion is especially good for working on thing that has many possible branches and are too complex for an interactive approach.

 


Post a Comment

Previous Post Next Post