题目:
题解:
#define MAX_NODE_SIZE 10000
int findBottomLeftValue(struct TreeNode* root){
int ret;
struct TreeNode** queue = (struct TreeNode **)malloc(sizeof(struct TreeNode) * MAX_NODE_SIZE);
int head = 0;
int tail = 0;
queue[tail++] = root;
while (head != tail) {
struct TreeNode *p = queue[head++];
if (p->right) {
queue[tail++] = p->right;
}
if (p->left) {
queue[tail++] = p->left;
}
ret = p->val;
}
free(queue);
return ret;
}