Solving Binary Tree Preorder Traversal in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Given a binary tree, return the preorder traversal of its nodes' values.

Example :

Input: [1,null,2,3]

Output: [1,2,3]

Follow up: Recursive solution is trivial, could you do it iteratively?

See the full details of the problem Binary Tree Preorder Traversal at LeetCode

Originally posted at: