We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Swap Nodes
Swap Nodes
Sort by
recency
|
15 Discussions
|
Please Login in order to post a comment
Scala solution
Yet another convoluted problem that hides three different problems in one. 1. Construct tree from given integers. 2. Swap certain nodes. 3. Print inorder.
This problem is so convoluted, I still don't entirely understand the requirement after staring at the description and examples for over 10 minutes.
Solution with Haskell
Why inorder traverse prints '2' at the beginning when there is still left-tree under 2 has not been visited?