Answers for "tree to array c++"

C++
0

tree to array c++

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()); 
}
Posted by: Guest on August-20-2021

Browse Popular Code Answers by Language