1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alekssr [168]
3 years ago
5

Is recursion ever required to solve a problem? What other approach can you use to solve a problem that is repetitive in nature?

Computers and Technology
1 answer:
Setler79 [48]3 years ago
8 0

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 f_{n}, we need to compute f_{n-1} and f_{n-2} 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 f_{i-1} and f_{i-2} to find the value of f_{i}

                           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.

You might be interested in
You want to divide the value in cell D3 by the value in cell E3. Which formula should you use?
Tom [10]
The formula is:
=D3/E3
4 0
3 years ago
Read 2 more answers
What are the characteristics of the Global Address List? Check all that apply.
nignag [31]

Answer:

It is the very last statement (bottom). Also copied to the the client

Explanation:

3 0
3 years ago
Which of the following is not true about managing your privacy settings? (select all that apply)
Evgesh-ka [11]
I'm going with 
<span>The things that you post online become public information.
and
</span><span>Employers screen job candidates based on social medias.

Because when you post online, you can very easily make your account private, or only share the post to a specified group of people.

Employers also screen job candidates based on their backround, personality, etc.</span>
4 0
4 years ago
Read 2 more answers
A database stores a large amount data in vertical ___
myrzilka [38]

Records for the first one and table for the second one

4 0
3 years ago
By arranging users into security groups, it is possible to set permissions at a group-level, avoiding the unwieldy alternative o
Anni [7]

Answer:

The department by department is arranging users into security groups to set permission at a group-level.

Explanation:

Team by team is just formed group method but the team been set will work on based on the project. Once the project is getting over then the team group assigned permission has to be disabled or deleted.

 

Department by department is just good methods where each department will have a list of users and easy to assign the group.

user-by-user. is just assigning the rights of each individual user. But if the user has multiple departments login it will be good advice.

organization-by-organization. It is just assigning rights to complete users list in the organization.  

6 0
3 years ago
Other questions:
  • Assume you're running a query on your orders in the past year. You want to see how many orders were placed after May. What type
    5·1 answer
  • What is the purpose of exporting your public key to the directory services server?
    11·1 answer
  • Which of the following are typically an example of primary resources?
    13·1 answer
  • Universal Containers has a sales team focused on renewals. They will use many of the same Opportunity fields as other teams, but
    13·1 answer
  • What types of information are commonly included in headers and footers? Check all that apply.
    10·1 answer
  • A seven-octet pattern of alternating 0s and 1s used by the receiver to establish bit synchronization is a _______
    11·1 answer
  • In C#Write the program SubscriptExceptionTest in which you use an array of 10 doubles. Write a try block in which you place a lo
    5·1 answer
  • Write a public static method named evens that takes in 1 argument int a, and returns a String containing all positive even numbe
    8·1 answer
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual whi
    9·1 answer
  • Why is a Quality assurance tester needed on a software development team?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!