An alternative to the 2-d tree is the quad tree. Figure 1 shows how a plane is partitioned by a quad tree. Initially, we have a region (which is often a square, but need not be). Each region may store one point. If a second point is inserted into a region, then the region is split into four equal-sized quadrants (northeast, southeast, southwest, and northwest). If this places the points in different quadrants (as when p2 is inserted), we are done; otherwise, we continue splitting recursively (as is done when p5 is inserted).
a. For a given set of N items, does the order of insertion affect the final partition?
b. Show the final partition if the same elements that were in the 2-d tree in Figure 2 are inserted into the quad tree.
Figure 1: The plane partitioned by a quad tree after the insertion of p1 = (53, 14), p2 = (27, 28), p3 = (30, 11), p4 = (67, 51), p5 = (70, 3)
Figure 2: Sample 2-d tree
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.