Binary Tree Inorder Traversal Problem

Binary Tree Inorder Traversal Problem — ExecCode Medium DSA Practice

Solve the Binary Tree Inorder Traversal problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given the root of a binary tree, return the inorder traversal of its nodes' values. Inorder Traversal: Left Subtree Root Right Subtree

Examples

Input root = [1, 2, 3, 4, 5, 6, 7, 8]; Output [8, 4, 2, 5, 1, 6, 3, 7]. Input root = [1, null, 2, 3]; Output [1, 3, 2]. Input root = [1]; Output [1]

Constraints

The number of nodes in the tree is in the range [0, 100]. -100 <= Node.val <= 100

Practice Binary Tree Inorder Traversal free on ExecCode. Browse DSA problems, topic map, and placement guides.