Accepted solution for C
int maxDepthTree (struct TreeNode* root);\n    void InOrder (struct TreeNode* root, int** array, int* nums, int depth);\n    void arrayAdd (int** array, int siz
    int maxDepthTree (struct TreeNode* root);\n    void InOrder (struct TreeNode* root, int** array, int* nums, int depth);\n    void arrayAdd (int** array, int size);\n    \n    int** levelOrder(struct TreeNode* root, int** columnSizes, int* returnSize) {\n      int maxDepth = *returnSize = maxDepthTree (root); \n      int** array = (int**) calloc (maxDepth, sizeof (int*));\n      *columnSizes = (int *) calloc (maxDepth, sizeof (int));\n      for (int i = 0; i < maxDepth; i++)\n        (*columnSizes)[i] = 0;\n      InOrder (root, array, *columnSizes, 0);\n      return array;\n    }\n    \n    int maxDepthTree (struct TreeNode* root)\n    {\n      if (root == NULL)\n        return 0;\n      int DepthL = maxDepthTree (root->left) + 1;\n      int DepthR = maxDepthTree (root->right) + 1;\n      return DepthL > DepthR ? DepthL : DepthR;\n    }\n    \n    void InOrder (struct TreeNode* root, int** array, int* nums, int depth)\n    {\n      if (root == NULL)\n        return;\n      InOrder (root->left, array, nums, depth + 1);\n      arrayAdd (&array[depth], nums[depth]);\n      array[depth][nums[depth]++] = root->val;\n      InOrder (root->right, array, nums, depth + 1);\n    }\n    \n    void arrayAdd (int** array, int size)\n    {\n      int* temp = *array;\n      *array = (int *) calloc (size + 1, sizeof (int));\n      for (int i = 0; i < size; i++)\n        (*array)[i] = temp[i];\n      free (temp);\n    }
[]