I'm afraid I can't work out how to reply to posts (might have something to do with not being the official asker of the question - I wasnt logged in when I posted it...), so I'm just posting this as an answer and I hope people will see it.
Firstly, thank you very much to everyone who pointed me in the direction of the wikipedia article - it has been invaluable.
However, it has led me to have another question, which I'm not sure if I should ask here or make another topic for. But I shall ask here regardless, and I'm sure I'll get told off if it's the wrong thing to do!
On the wiki page, in the description of the NN algorithm, it says
If the hypersphere crosses the plane,
there could be nearer points on the
other side of the plane, so the
algorithm must move down the other
branch of the tree from the current
node looking for closer points,
following the same recursive process
as the entire search. If the
hypersphere doesn't intersect the
splitting plane, then the algorithm
continues walking up the tree, and the
entire branch on the other side of
that node is eliminated.
This is represented in their LUA code example by:
-- search the near branch --
child = child_near(here,point)
And:
-- search the away branch - maybe -- ...
child = child_away(here,point)
I really don't get the 'child near' and 'child_away' parts - at first from the text description I thought it meant that I should traverse over to the equivalent level node on the opposite branch from the current node, but does this mean instead that one of the node's children is the "near" node, and one of them is the "away" node?
I apologise, but I'm very confused about this.
-Stephen