Back to problems

Build a Quadtree and Analyze a Graph

Algorithm · Uber · Hard

Part 1 — Build a Quadtree from an Image A square image is provided as an $$N \times N$$ integer matrix image, where N is always a power of two. Construct a quadtree for this matrix. A quadtree node represents a square region of the image: If every element in the region has the same integer value, the node is a leaf that stores that value. Otherwise, the node is an internal node with exactly four children, representing the region split into its top-left, top-right,…

Checking your access…