leetcode-helper
leetcode-helper copied to clipboard
TreeNode.bfs()
https://github.com/helloShen/leetcode-helper/blob/56bc2efee89405e1270bce8174e127fa2eef040a/src/main/java/com/ciaoshen/leetcode/util/TreeNode.java#L84-L85
For cases like:
1
/ \
null 2
I think the above two lines should be:
if (n != null) {
res.add(line);
break;
}