I'm trying to implement KD Tree in an app I build and the current example is something like this:
struct kd_node_t {
int trapID;
double x[MAX_DIM];
struct kd_node_t *left, *right;
};
struct kd_node_t wp[] =
{
{1, {2, 3}}, {1, {5, 4}}, {1, {9, 6}}, {1, {4, 7}}, {1, {8, 1}}, {1, {7, 2}}
};
What i'm trying to do is dynamically putting an array in the struct instead few like the example. Any ideas how shall I do that?
EDIT:
I realize the question should be different --> How can I initialize this specific struct from NSArray data?