← 返回 uber 的题目列表Spatial Quadtree: Insert and Range Query
类型:qbank
Design and implement a quadtree for latitude/longitude points. Support inserting a point with associated data and querying all points inside a rectangular range, then discuss overlapping points and tree balance.
Requirements
Model a two-dimensional quadtree that stores geographic points (latitude, longitude) with associated payload data.
Implement Insert(x, y, data) to add a point.
Implement Query(range) to return every stored point inside a rectangular boundary.
Discuss how the structure handles multiple points at the same coordinates.
Discuss subdivision limits and balancing behavior when points cluster heavily in one region.
Notes
Clarify whether rectangle boundaries are inclusive and how coordinates on quadrant boundaries are assigned.
Clarify the leaf capacity and minimum cell size before defining the split condition.