Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > recursion.
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 25453 of 28006
Post > Topic >>

recursion.

by pereges <Broli00@[EMAIL PROTECTED] > Apr 9, 2008 at 04:57 AM

AS I understand, there must be a stopping condition in recursive
functions.

suppose my function is like this -

void build_kdtree(kdnode *kd, int axis, int depth)
{

     if(kd->maxspheres <= MINSPHERES || depth >= DEPTHLIMIT)
     {
		kd->left = kd->right = NULL;

     }

    else
    {

           ,,,,,,,,

    build_kdtree(kd->left, axis, depth+1);
    build_kdtree(kd->right, axis, depth+1);

}

My question is -

1. Is the stopping condition in if sufficient or some return value is
also necessary
2. Is this a right way to build a recursive function ?
 




 5 Posts in Topic:
recursion.
pereges <Broli00@[EMAI  2008-04-09 04:57:58 
Re: recursion.
Chris Dollin <chris.do  2008-04-09 13:51:37 
Re: recursion.
pereges <Broli00@[EMAI  2008-04-09 07:15:04 
Re: recursion.
Chris Dollin <chris.do  2008-04-09 16:08:01 
Re: recursion.
Ben Bacarisse <ben.use  2008-04-09 16:11:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 11:02:55 CST 2008.