title: Binary Tree Transversing
body: <p>I'm really new to coding and was stuck at one of the Leetcode problems on Binary Tree Transversing.</p>
  <p>Can anyone please explain what the following line of code means:</p>
  <pre><code>def preorderTraversal(self, root: Optional[TreeNode]) -&gt; List[int]:
  </code></pre>
  <p>From what I understood, the core was trying to define a function pre-order traversal and a class TreeNode was defined earlier. However I was not able to get what root: Optional[TreeNode] and -&gt;List[int] meant.</p>
  <p>Thanks in advance</p>