void postorder(struct TreeNode* root, int* returnSize, int* a)
{
if (root == NULL)
{
return;
}
if (root != NULL)
{
postorder(root->left, returnSize, a);
postorder(root->right, returnSize, a);
a[*returnSize] = root->val;
(*returnSize)++;
}
}
int* postorderTraversal(struct TreeNode* root, int* returnSize)
{
int* a = malloc(100 * sizeof(int));
*returnSize = 0;
postorder(root, returnSize, a);
return a;
}
08-27