Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Binary Tree Inorder Traversal

XPChallenge Points: 10
levelLevel: Easy

Task:
You are given the root of a binary tree. Return the values of the nodes when traversed inorder (left → root → right).

Example 1:

Input: root = [2, 1, 3]

Output: [1, 2, 3]

Explanation:

Visit the left child 1 Visit the root 2 Visit the right child 3

Example 2:

Input: root = [5, 3, 6, 2, 4, None, 7]

Output: [2, 3, 4, 5, 6, 7]

Example 3:

Input: root = []

Output: []

Example 4:

Input: root = [10]

Output: [10]

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result