Complexity of quad tree's range search
<p>I've already searched for this information. Found this:</p>

<p><a href="https://groups.google.com/forum/#!topic/uw.cs.cs240/MGfrsvKAiMA" rel="nofollow noreferrer">https://groups.google.com/forum/#!topic/uw.cs.cs240/MGfrsvKAiMA</a></p>

<p>and this:</p>

<p><a href="https://stackoverflow.com/questions/37642688/how-can-worst-case-complexity-of-quad-tree-on">How can worst case complexity of quad tree O(N)?</a></p>

<p>, but I don't believe it answers my problem. The first one, perhaps, but I don't understand the explanation. Up to the point.</p>

<p>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 (<a href="https://en.wikipedia.org/wiki/Quadtree#Types" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Quadtree#Types</a>). Each region can hold only one entity. Each entity has its discrete coordinates.</p>

<p>I have implemented a method to find all entities in certain (discrete) AABB, working exactly as the <code>queryRange()</code> function in the aforementioned Wiki page.</p>

<p>My question is: what is the time complexity for this <code>queryRange()</code> function?</p>

<p>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.</p>

<p>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.</p>