Hello everyone,
I am a new memeber, and I need help in c++ code.
Actually I had a code that need kd tree data structure in order to find the nearest neighbour, so I found a kd tree that had been written in c++ as class and there is a function which specialized to find the parent of any given point and it starts with assigning a pointer by " this " and actaully I didn't understand it and in the mean time I didn't find good resources that explaine what does " this " means in general..is it special for classes or just stansered viriable and what does it mean
The function looks like that :
KDTEMPLATE
KDNODE* KDNODE::FindParent(Xtype* x0)
{
KDNODE* parent ;
KDNODE* next = this ;
int split ;
while(next)
{
split = next->axis ;
parent = next ;
if(x0[split] > next->x[split])
next = next->Right ;
else
next = next->Left ;
}
return parent ;
}
The entire stuff that related with this code is in the following link:
http://www.codeproject.com/KB/architecture/KDTree.aspx?display=Print
I thank you all in advance for any kind of help or advices