Ready to sort
tree ● Active ● Sorted
Nodes appear as the algorithm builds its structure.

Statistics

Status Idle
Operations 0 / 0

Controls

50
5x

Summary

Builds a min Cartesian tree and extracts roots through a priority queue.

How it Works

  • Build the Cartesian tree with a monotonic stack.

  • Extract the smallest available subtree root.

  • Add that root’s children to the priority queue and repeat.