KD Tree

· · 个人记录

Notice:

1.When you insert a node ,you should know left part contain [l,mid) ,right part contain [mid,r) .

2.If you recycle nodes , you should make the ls or rs become 0 when you rebuild but there is no son.

3.If you just pia the biggest tree ,you should remember to change the father's son and the rt .

Use:

1.ask for the nearist/farthest node pair

2.the sum of a area