educative.io

Adding and removing places from our index quickly

Notice that we are keeping Places’ data in a HashSet, this will enable us to add/remove Places from our index quickly. So now, whenever a QuadTree server needs to rebuild itself, it can simply ask the QuadTree Index server for all the Places it needs to store. This approach will surely be quite fast.

what’s the benefit of adding and removing places from our index quickly? aren’t we just trying to use the hashset to rebuild the quadtree. what does it have to do with adding and removing places?

Whenever a QuadTree server needs to rebuild itself, it can simply ask the QuadTree Index server for all the Places it needs to store.