```
def levelOrder(self, root):
queue = []
output = []
level = []
if root:
queue.append(root)
queue.append(None)
while queue:
node = queue.pop(0)
if node:
level.append(node.data)
if node.left:
queue.append(node.left)
if node.right:
queue.append(node.right)
else:
output.append(level)
if queue:
queue.append(None)
level= []
return output
```