keep moving

# Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).

For example:
Given binary tree {3,9,20,#,#,15,7},

    3
/ \
9  20
/  \
15   7


return its level order traversal as:

[
[3],
[9,20],
[15,7]
]


class Node{
int level;
TreeNode treenode;
public Node(int level,TreeNode treenode){
this.level = level;
this.treenode = treenode;
}
}

public class Solution {
public List<List<Integer>> levelOrder(TreeNode root) {
List<List<Integer>> result = new ArrayList<List<Integer>>();
if(root == null)
return result;
ArrayDeque<Node> queue = new ArrayDeque<Node>();
while(!queue.isEmpty()){
Node node = queue.pop();
if(node.level>result.size()){
List<Integer> list = new ArrayList<Integer>();
}else
if(node.treenode.left!=null)
if(node.treenode.right!=null)
}
return result;
}
}

#### LeetCode102 Binary Tree Level Order Traversal Java

2016-04-23 14:20:55

#### 102. Binary Tree Level Order Traversal [easy] (Python)

2016-05-10 14:40:58

#### LeetCode --- 107. Binary Tree Level Order Traversal II

2015-04-17 16:46:33

#### leetcode 之Binary Tree Level Order Traversal I和II 解题思路

2014-07-11 23:43:09

#### 【LeetCode】102. Binary Tree Level Order Traversal 解题报告

2016-05-26 15:06:54

#### leetcode 107 Binary Tree Level Order Traversal II C++

2016-05-28 20:57:50

#### [C++]LeetCode: 31 Binary Tree Level Order Traversal

2014-11-25 19:17:18

#### LeetCode 107:Binary Tree Level Order Traversal II

2015-05-31 00:11:23

#### leetcode 102 Binary Tree Level Order Traversal

2015-07-14 22:53:54

#### leetCode解题报告之Binary Tree Level Order Traversal II,I(二叉树层次遍历)

2014-03-28 20:28:01