lol4lol's blog

By lol4lol, history, 5 years ago, In English

It can be solve by storing node value in an array and then calculating the minimum difference by native approach. But i was trying to solve it using DFS. I have tried to see discussion of many solver who tried DFS but not getting out the actually how it has been solved by DFS. Can anyone help me by figure(skecth by nodes) out the way DFS would work to solve this problem? Thanks in Advance.

One of Discussions: https://leetcode.com/problems/minimum-distance-between-bst-nodes/discuss/856052/My-Java-SOlution-DFS/705372 Problem Link: https://leetcode.com/problems/minimum-distance-between-bst-nodes/

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it