Level Order Traversal

Tree Traversal Algorithm: How do you traverse a binary tree level order (iteratively)? What are its use cases?

Assume:

class TreeNode:
    def __init__(self, val):
        self.val = val
        self.right = None
        self.left = None

def level_order(root):
    if not root:
        return []
    queue = [root]
    res = []
    while queue:
        current_level = []
        next_level = []
        for node in queue:
            current_level.append(node.val) # additional logic here!
						if node.left:
                next_level.append(node.left)
            if node.right:
                next_level.append(node.right)
        queue = next_level
        res.append(current_level)
    return res