Bmi*_*s13 7 algorithm computational-geometry data-structures
我最近在采访中被问到以下问题:
假设你在笛卡尔坐标系(Quadrant I)上跟随网格.
o - x - x - x - o
| | | | |
x - x - x - o - x
| | | | |
x - o - o - x - x
where, o => person at intersection and x => no person at intersection
class Point {
int x;
int y;
boolean hasPerson;
}
Point findNearestPointWhereAllPeopleCanMeet(Point[] people) {
}
Run Code Online (Sandbox Code Playgroud)
在给定人员位置(点)列表的情况下实施例程,找到最接近所有给定点的位置(点).
你会如何解决这个问题?
1)方法是kd树,但是你知道其他任何解决方案吗?