Update a Layer Tree Preserving Z-Order
Problem
Given a layer tree, implement operations: reorder a layer (preserve z-order), reparent a layer, or compute the front-to-back render order.
Example
layers tree -> move layer up one; recompute z-order
Constraints
- Preserve sibling order; handle reparent into descendant
What to look for
Call out time/space trade-offs and edge cases before being asked.
asked …