Consider i have set of ranges that an item can be in, and a given item, which data structure is considered fastest to provide the range that considered the closest to the item? I also care for space complexity so bring that into consideration.
a 1 dimensional example for the use case is frequency, consider we have frequency ranges and a frequency, we wish to find the closest frequency range to that frequency.
a 2 dimensional example is a game, consider we have a ball and objects on a plane, we divide objects to groups and want to find which of the groups is the closest to the ball.