Answer:
No you can not tell that recursion is ever required to solve a problem.
Recursion is required when in the problem, the solution of the input depends on the solution of the subsets of the input.
Iteration is also another form of repetitive approach we follow to solve that kind of problems.
But the difference between recursion and iteration is :
- In recursion we call the function repeatedly to return the result to next level.
- In iteration certain bunch of instructions in a loop are executed until certain conditions met.
Explanation:
For example in the Fibonacci sequence problem, to find
, we need to compute
and
before that.
- In case of recursion we just call the method Fibonacci(n) repeatedly only changing the parameter Fibonacci(n-1), that calculates the value and return it.
Fibonacci(n)
1. if(n==0 or n==1)
2. return 1.
3.else
4. return( Fibonacci(n-1)+Fibonacci(n-1) )
- But in case of iteration we run a loop for i=2 to n, within which we add the value of current
and
to find the value of 
Fibonacci(n)
1. if(n<=2)
2. result = 1
3. else
4. result1 =1 and result2=1.
5. { result = result1 +result2.
6. result1= result2.
7. result2 = result.
8. }
9. output result.
Answer:
The function in Python is as follows:
def MaxValue(userNum1, userNum2):
if userNum2>userNum1:
return userNum2
else:
return userNum1
Explanation:
This defines the function
def MaxValue(userNum1, userNum2):
This returns userNum2 if userNum2 is greater than userNum1
<em> if userNum2>userNum1:</em>
<em> return userNum2</em>
If otherwise, this returns userNum1
<em> else:</em>
<em> return userNum1</em>
<em />
Answer:
B. Copyright
Explanation:
Joe needs to consider the Copyright as it is the legal means of protection of an author's work; it is the intellectual property that provides exclusiveness to the author's work, which menas that all the content and work created by the author, and protected by copyright cannot be used or published by anyone else without the consent of the author. For that reason, if the picture used by Joe has copyright it cannot be used in his project.
Answer:
An open source operating system
Explanation:
Linux is an open source operating system (OS). An operating system is the software that directly manages a system's hardware and resources, like CPU, memory, and storage.