Simple and crystal clear C solutions
\nstruct TreeNode* newNode(val)\n{\n    struct TreeNode* p = (struct TreeNode*)malloc(sizeof(struct TreeNode));\n    p->val = val;\n    p->left = p->right = NUL
```\nstruct TreeNode* newNode(val)\n{\n    struct TreeNode* p = (struct TreeNode*)malloc(sizeof(struct TreeNode));\n    p->val = val;\n    p->left = p->right = NULL;\n    return p;\n}\n\nstruct TreeNode* buildTree(int* inorder, int inorderSize, int* postorder, int postorderSize) {\n    if (!inorder || !postorder || (inorderSize != postorderSize) || inorderSize <= 0) return NULL;\n    \n    int rootVal = postorder[postorderSize - 1];\n    struct TreeNode* root = newNode(rootVal);\n    int idx = 0;\n    for (; idx < inorderSize - 1; idx++)\n    {\n        if (inorder[idx] == rootVal) break;\n    }\n    root->left = buildTree(inorder, idx, postorder, idx);\n    root->right = buildTree(inorder+idx+1, inorderSize-idx-1, postorder+idx, inorderSize-idx-1);\n    return root;\n}\n```\n\nI could get such straight-forward solution in C with the help of C pointer arithmetic. In fact, I am also trying \nwith C++ vectors, but I think Cpp Vectors would not convenient (I am not skillful in Cpp), :(\n
['Recursion', 'C']