Partition a Binary Tree

Правка en2, от go_rob, 2017-04-07 17:08:32

Given a binary tree,

We have to remove a single edge and partition the tree into two new trees such that difference of their diameters remains less than a given constant k.

Please suggest me an approach of O(n) time complexity.

Теги dynamic programming, #trees, #dfs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский go_rob 2017-04-07 17:08:32 0 (published)
en1 Английский go_rob 2017-04-07 17:08:17 266 Initial revision (saved to drafts)