开发者

algorithm for searching in ranges

开发者 https://www.devze.com 2023-03-19 02:02 出处:网络
I am given a huge list of objects with attributes x and y. We are require开发者_运维技巧d to search for all objects lying between a given upper and lower bound of both the attributes.

I am given a huge list of objects with attributes x and y. We are require开发者_运维技巧d to search for all objects lying between a given upper and lower bound of both the attributes.

I was wondering if there is an efficient algorithm to implement this.

Thanks!


There are standard algorithms for this. See http://en.wikipedia.org/wiki/R-tree for one.


A quadtree or a spatial index (a space-filling curve, for example a hilbert curve).

0

精彩评论

暂无评论...
验证码 换一张
取 消