I've already searched for this information. Found this:
https://groups.google.com/forum/#!topic/uw.cs.cs240/MGfrsvKAiMA
and this:
How can worst case complexity of quad tree O(N)?
, but I don't believe it answers my problem. The first one, perhaps, but I don't understand the explanation. Up to the point.
I've got a quad tree over a discrete space (2d square table of entities). It is a region tree, as explained in english Wikipedia page (https://en.wikipedia.org/wiki/Quadtree#Types). Each region can hold only one entity. Each entity has its discrete coordinates.
I have implemented a method to find all entities in certain (discrete) AABB, working exactly as the queryRange()
function in the aforementioned Wiki page.
My question is: what is the time complexity for this queryRange()
function?
I've tried figuring it out myself, but it seems to depend on many various factors, such as: depth of the tree, number of elements in the tree, size of given AABB. I think in its core it is related to number of sub-trees visited by queryRange() recursion.
Also I'd be thankful for any credible sources on that. I'm writing a master thesis and I need citations. I really can't seem to google anything good on this topic though.