pub fn tree_json(nodes: &[TreeNode<'_>], roots: &[usize]) -> Result<String>
Serializes the trees under roots without recursion, so a long linear session cannot exhaust the stack.
roots