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()); }