📜  树到数组 C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:46.425000             🧑  作者: Mango

代码示例1
int[size] array = new int[size]; 
int index = 0; 
void storeInOrder(node root) { 
    if (node == null) 
        return; 
    storeInOrder(root.leftChild()); 
    array[index++] = root.value; 
    storeInOrder(root.rightChild()); 
}