Flatten a Binary Tree to a Linked List (in-place)

Today, I explored a classical tree manipulation problem — flattening a binary tree into a linked list in-place, maintaining the preorder…