tcquery's blog

By tcquery, history, 4 weeks ago, In English,

You can colour nodes in a tree by “marking” some of the tree nodes. Marked nodes may not be closer to each other than distance D. Find the maximum number of nodes that you can mark. The nodes are numbered from 1 to N.

How do I solve this in better than O(n^2)


  • Vote: I like it  
  • +11
  • Vote: I do not like it  

4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

You can find solutions here.