What are some examples of problems that can be solved by solving smaller version
ID: 3589145 • Letter: W
Question
What are some examples of problems that can be solved by solving smaller versions of the same problem?
Recursions: linked lists, factorial of a natural number, greatest common divisor
If you find a better way of solving a problem, what are some of the benefits to having that solution in a function?
This is the question I'm having problems with? Can't think of a good answer. If I find a better way of solving a problem, ummm, if you can find to solution to a problem it must be a pretty simple problem so you'll be able to know if you mess up?
Explanation / Answer
Below are the some of the benefits of using functions in problem solving (WRT Programming i can think o):
1. We can re-use the solution from any where using the packing feature. Like in java we can import the package and use the function.
2. If we would like to improve the solution in terms of space or time complexity, all we need to do is make changes to the original function and package it.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.