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
What is a license that is paid for by number of machines or number of people using the software?.
Kamila [148]

A license that is paid for based on the number of machines or number of people using the software application (program) is called: purchased license.

<h3>What is a software license?</h3>

A software license can be defined as a formal agreement between an end user (customer) and the owner of a software program or software developer, that allows him or her to perform certain tasks with the software application (program).

<h3>The types of software.</h3>

In Computer technology, there are three (3) main types of software programs based on usage rights and these include the following:

  • Shareware
  • Freeware
  • Purchased license

In conclusion, a purchased license is a type of license that is typically being paid for based on the number of machines or number of people that are using the software application (program).

Read more on software here: brainly.com/question/25703767

5 0
2 years ago
Think of a simple software project that requires your design skills. Specify the requirements needed on each design process
andrew-mc [135]

Answer:In this guide, we'll go over the basics of your software development ... I know which option I'd choose. ... Will you need to integrate with other tools or APIs? ... With the requirements in place, it's time to start designing what this ... In its most basic form, you can think of the Waterfall method as following each ...

Explanation:

4 0
3 years ago
Write the pseudocode to this flowchart.
aleksandr82 [10.1K]

Answer:

I don't understand

Explanation:

4 0
2 years ago
The ____ package contains frequently used classes and is implicitly imported into java programs.
Snowcat [4.5K]

Java.lang is the answer you're looking for

8 0
3 years ago
Bayley wants to connect a new external hard drive to his Windows PC. He wants the fastest connection type available because he p
USPshnik [31]

Answer:

Thunderbolt 3

Explanation:

Bayley certainly needs the fastest connection possible for his work. The best connection type for this kind of work is the Thunderbolt 3. Thunderbolt 3 is an improvement of the previous Thunderbolt 2 developed by Intel. Thunderbolt 3 has two times the speed of Thunderbolt 2. Theoretically, its maximum throughput is approximately 40 Gbps.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following correctly identifies a voltage source and its method of developing electric potential?
    7·2 answers
  • With ____ editing, Word automatically displays a Paste Options button near the pasted or moved text.
    14·1 answer
  • There is a simple method for constructing a magic square for any odd value of n:
    15·1 answer
  • Sharon is a skilled professional who operates logging equipment.
    12·2 answers
  • The most fundamental components of storage that users interact with are the:
    11·1 answer
  • How can you enter Task Manager in Windows? Select 3 options. press Ctrl + Shift + Tab press Ctrl+Alt+Delete and then click Task
    8·1 answer
  • ______The statement #include &lt; math.h &gt; defines the name of the current program you are writing as "math". (T/F)
    10·2 answers
  • How can parents be health educators in family​
    13·1 answer
  • Select the correct answer.
    14·2 answers
  • What is the difference between autofocus and autocomplete
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!