Stuck on dynamic programming.

Правка en1, от speedster, 2017-10-04 17:20:27

problem : in a rooted binary tree with n nodes, each node has a positive value( v(i) ) you need to select k(k<=n) nodes from the tree. if a node is selected you must select all of its ancestors.design a dp algo for maximum possible value of k selected nodes

Теги #dp, dynamic programming, #trees, binary tree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский speedster 2017-10-04 17:20:27 297 Initial revision (published)