Your question is In-Order Traversal Implementation. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Cloudera Manager represents hierarchical configuration data with tree structures. Given the root of a binary tree, return its node values in in-order sequence: visit the left subtree, then the current node, then the right subtree.
Implement the traversal iteratively using an explicit stack. The input is provided as a TreeNode object whose fields are val, left, and right. The evaluation harness constructs the tree from a level-order array, where null represents a missing child. Return a Python list of node values.
def inorder_traversal(root):