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


Graphics > Algorithms > how to free a d...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 4835 of 5015
Post > Topic >>

how to free a dynamically allocated kd tree ?

by broli <Broli00@[EMAIL PROTECTED] > Jun 30, 2008 at 04:35 AM

Hi, I have created a kdtree (dynamically) using median cut approach
and now i want to free it. Here's my data structure :

typedef struct kdnode_s
{
    bbox box; /* Bounding box */
    char split_plane; /* 0:- x, 1:- y, 2 : z  -1 : leaf*/
    union
    {
        struct
        {
            struct kdnode_s *child[2]; /* two child nodes
            double split; /* split point */

        }nonleaf;

        struct
        {
            unsigned long nt; /* no: of triangles in node */
            triangle **tpa; /* triangle list */

        }leaf;

    }u;

}kdnode;


I tried to think over a few methods like postorder traversal etc but
it won't work in this scenario. what to do ?
 




 4 Posts in Topic:
how to free a dynamically allocated kd tree ?
broli <Broli00@[EMAIL   2008-06-30 04:35:12 
Re: how to free a dynamically allocated kd tree ?
Kiuhnm <kiuhnm03.4t.ya  2008-06-30 14:52:36 
Re: how to free a dynamically allocated kd tree ?
broli <Broli00@[EMAIL   2008-06-30 06:09:11 
Re: how to free a dynamically allocated kd tree ?
Kiuhnm <kiuhnm03.4t.ya  2008-06-30 16:02:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sun Oct 12 2:31:05 CDT 2008.