java.lang.Object
g0101_0200.s0102_binary_tree_level_order_traversal.Solution

public class Solution extends Object
102 - Binary Tree Level Order Traversal.<p>Medium</p> <p>Given the <code>root</code> of a binary tree, return <em>the level order traversal of its nodes&rsquo; values</em>. (i.e., from left to right, level by level).</p> <p><strong>Example 1:</strong></p> <p><img src="https://assets.leetcode.com/uploads/2021/02/19/tree1.jpg" alt="" /></p> <p><strong>Input:</strong> root = [3,9,20,null,null,15,7]</p> <p><strong>Output:</strong> [[3],[9,20],[15,7]]</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> root = [1]</p> <p><strong>Output:</strong> <a href="1">1</a></p> <p><strong>Example 3:</strong></p> <p><strong>Input:</strong> root = []</p> <p><strong>Output:</strong> []</p> <p><strong>Constraints:</strong></p> <ul> <li>The number of nodes in the tree is in the range <code>[0, 2000]</code>.</li> <li><code>-1000 <= Node.val <= 1000</code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details