Computer Programming

Database Design

Computer Science

# What is recursive algorithm?

## Answer

###### Wiki User

###### 12/18/2014

Algorithm can be defined as an interpretable, finite set of instructions for dealing with contigencies and accompanying task that has recognizable end-points for given inputs. It is a tool for solving a well computational problem. A recursive algorithm is one which calls itself.

###### Wiki User

###### 04/08/2009

A recursive program/algorithm is one that calls itself again.

## Related Questions

###### Asked in C Programming, C++ Programming

### When you choose iterative or recursive algorithm?

If you cannot find any iterative algorithm for the problem, you
have to settle for a recursive one.
...

Read More

###### Asked in Computer Programming

### What are properties of recursive algorithm?

a function that calls itself.

Read More

###### Asked in Computer Programming, Database Design, Computer Science

### What is recursive call in terms of algorithm?

An algorithm is a set of instructions that do some task. An
algorithm can recursive or non recursive calls. A recursive call is
when a function calls itself.
...

Read More

###### Asked in Prime Numbers

### Recursive algorithm to check a no is prime or not?

Suck a dick until it works

Read More

###### Asked in Computer Programming

### What causes a recursive algorithm to stop calling itself?

If the condition has been reached.

Read More

###### Asked in Computer Programming, C Programming

### How do you write recursive algorithm?

Any algorithm, that refers to itself is recursive.
Trivial example:
gcd (a, b) :=
a if b=0
b if a=0
gcd (a mod b, b) if a>=b
gcd (b mod a, a) if a<b
...

Read More

###### Asked in C Programming

### How can you convert a simple algorithm to recursive algorithm?

Linear search(a,item)
n=length(a)
for i=1 to n do
if(a[i]==item) then return i
end for
return -1
...

Read More

###### Asked in Computer Programming, Math and Arithmetic, C Programming

### What is recursive algorithm and write a recursive algorithm to reverse a string also trace it for any string data?

A recursive algorithm is an algorithm which calls itself with
"smaller (or simpler)" input values, and which obtains the result
for the current input by applying simple operations to the returned
value for the smaller (or simpler) input.
Heres a recursive algorithm to reverse a string
char *rev(char str[],int pos1,int pos2)
{
if(pos1<pos2)
{
char temp=str[pos1];
str[pos1]=str[pos2];
str[pos2]=temp;
return rev(str,pos1+1,pos2-1);
}
return str;
}
You can call this function like this
char *r=rev("reverse it",0,9);
...

Read More

###### Asked in Computer Programming, Database Programming, C Programming

### Explain non-recursive and recursive algorithm for postorder traversal on binary tree?

Step 1:- select first root node (t), start travelsing left
contin

Read More

###### Asked in Computer Programming, Math and Arithmetic, Algebra, Numbers

### Design recursive algorithm for computing 2n for any non negative integer n which is based on the formula2n2n-1 2n-1?

The formula, as far as I can see, is not appropriate for the
algorithm.

Read More

###### Asked in Computer Programming, Math and Arithmetic

### How do you do algorithm?

n.
A step-by-step problem-solving procedure, especially an
established, recursive computational procedure for solving a
problem in a finite number of steps.
Read more: http://www.answers.com/topic/algorithm#ixzz1sURIfGSo
...

Read More

###### Asked in C Programming

### Why recursive and non-recursive delivers wrong result?

Recursive and non-recursive (also known as iterative) are simply
two different approaches to solving a problem. Properly
implemented, they should give the same result. If they do not, then
something is wrong, and you should spend the time to figure out
why.
This is a generic answer, because the topic is too broad to
answer here, as there are many different reasons that a particular
algorithm may fail.
...

Read More

###### Asked in Computer Programming, C Programming

### Write and explain recursive backtracking algorithm for n-queens?

This is not a question, this is your homework.
For a start, read this:
https://en.wikipedia.org/wiki/Eight_queens_puzzle
...

Read More

###### Asked in C Programming

### What is the recursive algorithm for find the factorial of n?

int fact(n) { return (n == 2 ? 2 : n * fact(n-1)); }

Read More

###### Asked in C Programming

### How do you choose between recursion and iteration?

Some problems cry out for recursion. For example, an algorithm
might be defined recursively (e.g. the Fibonacci function). When an
algorithm is given with a recursive definition, the recursive
implementation is straight-forward.
However, it can be shown that all recursive implementations have
an iterative functional equivalent, and vice versa.
Systems requiring maximum processing speed, or requiring
execution within very limited resources (for example, limited stack
depth), are generally better implemented using iteration.
...

Read More

###### Asked in C Programming, Computer Programming

### Write a recursive algorithm to find the factorial of a number?

int fact (int n) {
if (n==0) return 1;
return n* fact(n-1);
}

Read More

###### Asked in C Programming

### Which data structure would you most likely see in a nonrecursive implementation of a recursive algorithm?

Probably, you would see a stack.
A recursive algorithm works by calling itself, each time with
different data. So, to simulate that without actual recursion, you
would need to track the changing data on some kind of stack. This
would allow the data to be processed in a last-in-first-out order,
which is how recursion works.
...

Read More

###### Asked in Java Programming, C Programming, The Difference Between

### How can you differentiate between recursive and non recursive functions?

See if the fuction calls itself, if yes, it's recursive
otherwise it's not a recursive function.
...

Read More

###### Asked in C Programming, Math and Arithmetic, Database Design

### Design a non recursive algorithm for the towers of hanoi puzzle?

I don't want to spoil your fun, let it be sufficient to say that
it is not trivial, but not that hard either. If you are to lazy to
do it, consult wikipedia (attached link).
...

Read More

###### Asked in Definitions

### What is the definition of recursive?

The term recursive refers to the recurrence or repetition.

Read More

###### Asked in Medical Terminology, Definitions

### What does the word recursive mean?

Something that is recursive is something that repeats.

Read More

###### Asked in C Programming, Computer Terminology, Computer Programming

### Are all recursive programs non recursive?

None of them is, obviously.

Read More

###### Asked in The Difference Between

### 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.
...

Read More

###### Asked in Computer Programming, Engineering, Computer Science

### How do you overcome limitations of stacks in polygon filling?

You overcome limitations of the stack in polygon filling, or in
any other algorithm, far that matter, but using an iterative
technique, rather than a recursive technique. Recursion is quite
useful, and can simplify algorithm design. Polygon filling,
however, is a class of algorithm can potentially have a very deep
recursion depth. This causes stress on the stack, hence the need
for iteration.
...

Read More

###### Asked in Math and Arithmetic, Algebra

### Is 4 9 19 39 79 159 recursive?

no it is not recursive

Read More