An optimal algorithm for decomposing a window into maximal quadtree blocks

Abstract. Decomposing a two-dimensional window (i.e., the region specified by the cross product of two closed intervals over a given two-dimensional space) into its maximal quadtree blocks means to find the set of black quadrants that would be obtained by representing the region covered by the window using a quadtree. In this paper we propose an optimal O(n) time algorithm for decomposing a square window of size $n \times n$ embedded in an image space of $T \times T$ pixel elements, thus improving the O(n log log T) time algorithm of Aref and Samet [2]. As a direct consequence of this new faster algorithm, classical window operations on main memory quadtree based data structures can be solved more efficiently. In particular, we show that the exist and report queries on the incomplete pyramid [1] and on the up-down pyramid [8] can be solved in O(n) time, which is optimal.