Given the root of a binary tree, flatten the tree into a linked list using the same TreeNode class where the right child pointer points to the next node and the left child pointer is always null.