|  | 
|  | 
| back to board | save the max and min difference with the root, use the disjoint-set [code deleted]
 Edited by moderator 06.10.2011 16:00
Re: save the max and min difference with the root, use the disjoint-set Don't think it is correct to post AC code or even another pieces of code anyway! BTW, I solved this problem using binary search by the answer + DFS, without any data structure at all. | 
 | 
|