Leetcode: Find-bottom-left-tree-value
Please review for performance.


The performance looks fine to me. Some key observations:


It's clear that all nodes must be visited to compute the correct answer, so the solution cannot be better than \$O(n)\$ time.
Traversing in level order as you did will require as much additional space as the number of nodes on the most dense level.
Traversing depth first would require as much additional space as the longest path from root to leaf.


Without knowing in advance the shape of the tree (whether it's deep or wide),
and given TreeNode as defined and no additional helper data structures,
it's not possible to tell whether DFS or BFS is better.
So they are both equally fine, as neither uses space excessively.