tree to array c 2b 2b

Solutions on MaxInterview for tree to array c 2b 2b by the best coders in the world

showing results for - "tree to array c 2b 2b"
Camilla
13 Aug 2018
1int[size] array = new int[size]; 
2int index = 0; 
3void storeInOrder(node root) { 
4	if (node == null) 
5		return; 
6	storeInOrder(root.leftChild()); 
7	array[index++] = root.value; 
8	storeInOrder(root.rightChild()); 
9} 
queries leading to this page
tree to array c 2b 2btree to array c 2b 2b