How can I find the minimum number of modifications of value changes of a binary tree to get a BST?
As in the picture, I am not sure what method to use to get the minimum number of modifications to change the node values of a binary tree to get a BST, I’m searching for a long time on net and tried to change values bottom-up, but got the wrong answer. Please help or try to give some ideas how to achieve thisfull description of this problem, thanks in advance