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.
Hint: don't perform actual subtree swaps, just collect queries and take them into account while traversing tree.
I've implemented this in Erlang, works very well.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Swap Nodes
You are viewing a single comment's thread. Return to all comments →
Hint: don't perform actual subtree swaps, just collect queries and take them into account while traversing tree. I've implemented this in Erlang, works very well.