[ C ] Using Queue! BFS | Implementing My Own Queue
\ntypedef struct TreeNode TreeNode;\nstruct node{\n    struct node*next;\n    TreeNode* val;\n};\ntypedef struct node node;\nstruct queue{\n    node*root;\n    
```\ntypedef struct TreeNode TreeNode;\nstruct node{\n    struct node*next;\n    TreeNode* val;\n};\ntypedef struct node node;\nstruct queue{\n    node*root;\n    node*tail;\n    int size;\n};\ntypedef struct queue queue;\nnode* createnode(){\n    node*temp = (node*)malloc(sizeof(node));\n    temp->val = NULL;\n    temp->next = NULL;\n    return temp;\n}\nvoid push(queue*q,TreeNode*val){\n    node*new = createnode();\n    new->val = val;\n    if(q->size==0)\n        q->root = new;\n    else\n        q->tail->next = new;\n    q->tail = new;\n    q->size++;\n}\nTreeNode*pop(queue*q){\n    node*temp = q->root;\n    TreeNode*ret = temp->val;\n    if(q->size==1)\n        q->tail = NULL;\n    q->root = q->root->next;\n    q->size--;\n    return ret;\n}\nint maxLevelSum(struct TreeNode* root){\n    queue* q = (queue*)malloc(sizeof(queue));\n    q->size=0;\n    q->root=NULL;\n    q->tail=NULL;\n    push(q,root);\n    int level=0;\n    int result=1;\n    int maxSum=root->val;\n    while(q->size){\n        level++;\n        int size = q->size;\n        int currSum = 0;\n        for(int i=0;i<size;i++){\n            root = pop(q);\n            currSum+=root->val;\n            if(root->left)\n                push(q,root->left);\n            if(root->right)\n                push(q,root->right);\n        }\n        if(maxSum < currSum){\n            maxSum = currSum;\n            result = level;\n        }\n    }\n    return result;\n}\n```
['C']