C - Iterative Solution using a Queue
c\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     struct TreeNode *left;\n *     struct TreeNode *right;\n * };\n */\
```c\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     struct TreeNode *left;\n *     struct TreeNode *right;\n * };\n */\n\n#include <stdlib.h>\n\nint ** levelOrder (struct TreeNode * root, int * returnSize, int ** returnColumnSizes) {\n    *returnSize = 0;\n    if (!root) {\n        *returnColumnSizes = NULL;\n        return NULL;\n    }\n    struct TreeNode * q[1001];\n    int head = 0;\n    int tail = 0;\n    int ** ret = malloc(sizeof *ret * 2000);\n    *returnColumnSizes = malloc(sizeof **returnColumnSizes * 2000);\n    q[tail++] = root;\n    while ((tail - head) % 1001) {\n        int sz = (*returnColumnSizes)[*returnSize] = (tail - head) % 1001;\n        ret[*returnSize] = malloc(sizeof **ret * sz);\n        for (int i = 0; i < sz; i++) {\n            struct TreeNode * p = q[head++ % 1001];\n            ret[*returnSize][i] = p->val;\n            if (p->left)\n                q[tail++ % 1001] = p->left;\n            if (p->right)\n                q[tail++ % 1001] = p->right;\n        }\n        (*returnSize)++;\n    }\n    return ret;\n}\n```
['Queue', 'C', 'Iterator']