You are given the root of a binary tree.
Your task is to flatten the tree into a "linked list". This "linked list" should utilize the same TreeNode class. In this transformed structure, the right child pointer of each node should point to the subsequent node in the list, and the left child pointer must always be null. The order of the nodes in the "linked list" must exactly match the pre-order traversal sequence of the original binary tree.
The tree has three nodes with values 1, 2, and 3. The flattened linked list will have the same values in pre-order traversal order.
None
None
An empty tree contains no elements, so the result is also empty.