how to solve this problem ?

Правка en2, от learner_321, 2017-12-24 15:15:31

Given a binary tree,where each node has value given x, (x>=0).

you need to find maximum sum of nodes's x value ,but you can not select two nodes in the answer such that one node is parent (only immediate),and other is child.

like if 1 is root , and its left child is 2 and right child is 3 ,then you can not include 1 and 2, or 1 and 3 in the answer,but you can include 2-3.

find maximum possible sum...

Теги #trees

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский learner_321 2017-12-25 06:41:31 27 Tiny change: 'ble sum...' -> 'ble sum...\n\nNumber of nodes<= (1e6)'
en2 Английский learner_321 2017-12-24 15:15:31 26
en1 Английский learner_321 2017-12-24 15:14:30 415 Initial revision (published)