educative.io

Educative

Building a quad tree

How will we build a QuadTree? We will start with one node that will represent the whole world in one grid. Since it will have more than 500 locations, we will break it down into four nodes and distribute locations among them. We will keep repeating this process with each child node until there are no nodes left with more than 500 locations.

how do we break a parent node into four child nodes? do we just do it by lat/long, so each child has the same area?

1 Like