answersLogoWhite

0


Best Answer

Insert (Node *root, Node *newp)

{

if (root->left==NULL) { root->left= newp; return; }

if (root->right==NULL) { root->right= newp; return; }

Insert (root->left, newp);

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Give a recursive version of the tree-insert?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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


Are all recursive programs non recursive?

None of them is, obviously.


What does the word recursive mean?

Something that is recursive is something that repeats.


What is the definition of recursive?

The term recursive refers to the recurrence or repetition.


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.


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 4 9 19 39 79 159 recursive?

no it is not recursive


What does recursive mean?

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


Why recursive solution is better for tree traversal?

Because a tree is a recursive data-structure. It's easier to write (and easier to understand) a recursive program for handling it.


What is the difference between function and recursive function?

I will explain in the easiest way the difference between the function and recursive function in C language. Simple Answer is argument of the function is differ but in the recursive function it is same:) Explanation: Function int function(int,int)// function declaration main() { int n; ...... ...... n=function(a,b); } int function(int c,int d) { ...... ...... ...... } recursive Function: int recursive(int,int)// recursive Function declaration main() { int n; ..... ..... ..... ..... n=recursive(a,b); } int recursive(int a,int b) { ..... .... .... .... } Carefully see, In the recursive Function the function arguments are same.


What is a recursive relationship?

a function that recalls itself again and again is called recursive relationship.


How can you use recursive in a sentence?

"Computer programs often use recursive subroutines to repeat operations." "The goal recursive model of the Tower of Hanoi was identified by Nowell and Simon."