Problem
Given the root of a binary tree, return the values in pre-order traversal: visit the current node, then the left subtree, then the right subtree. Implement the traversal and handle an empty tree correctly.
Constraints
0 <= number of nodes <= 10^4-10^4 <= Node.val <= 10^4- The tree may be empty
Practicing as: Mobile Engineer interview at BellHi, I'll play your Bell interviewer for the Mobile Engineer role. Answer the question above like we're in the room, and I'll respond the way a real interviewer would.
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.


