answersLogoWhite

0

The two properties of a recursive object or routine, F, are:

  1. F must have a simple base case (or have simple base cases).
  2. F must have a set of rules that reduces all other cases towards the base case.

A classic example of recursion is the definition of a factorial.

Fact(0) = 1

Fact(n) = n * Fact(n - 1)

For computer science, writing this function in JavaScript would look like:

function factorial(n) {

if (n === 0) {

return 1;

} else {

return n * factorial(n - 1);

}

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What does recursive mean?

Recursive refers to using a rule or procedure that can be applied repeatedly.


What is the difference between a geometric sequence and a recursive formula?

what is the recursive formula for this geometric sequence?


Write a c program to find GCD of two given integers by using both recursive n non recursive functions?

i love u darling


Could you determine the recursive rule or formula if you only knew the first two terms in a sequence?

In general, it is not possible to uniquely determine a recursive rule or formula with only the first two terms of a sequence. While the initial terms can suggest a pattern, multiple recursive sequences can produce the same first two terms. To accurately derive a recursive rule, additional terms are typically needed to identify the underlying pattern or relationship governing the sequence.


What is recursive association?

a recursive association - as a aggregation is a special form of association, so recursive aggregation can be called as recursive association ... AKASH SISODIYA ......IT ...


GCD of two numbers in 8086?

Use Euclid's algo. You can do it in a recursive or iterative manner.


Did you mean recursion?

By definition, recursion means the repeated application of a recursive definition or procedure. It is used to define an object in terms of itself in computer science and mathematical logic.


What does the word recursive mean?

Something that is recursive is something that repeats.


Are all recursive programs non recursive?

None of them is, obviously.


What is the definition of recursive?

The term recursive refers to the recurrence or repetition.


What is set difference between recursive and recursively enumerable but not recursive?

All recursive Languages are recursively enumerable. But not all the recursively enumerable languages are recursive. It is just like NP complete.


Is procedure a physical or chemical property?

Procedures are not properties.