
772 A Practical Guide to Data Structures and Algorithms Using Java
Correctness Highlights: The search begins at the root of the quad tree. By INORDER, we know
that at each node, either we find a match at that node or we can use the x and y coordinates of the
node’s element and the target to determine a single quadrant in which the search should proceed.
This decision is made by the comparator, which returns 4 if a match is found. At each iteration,
the parent of the frontier node is set to the current node before proceeding down the tree to the
next level. In this way, when a frontier node is reached in the search path, its parent already will
hav