By applying K-D trees data structure, the program would do the map search based on provided x and y coordinates.