Min number of police man could be placed on the nodes which does not have
leaf nodes.
Only things needs to find out is the height of the tree.O(logn).

For any given tree:  1. calculate the leaf node: 2^h  (h is the height of
the tree)
                             2. Subtract leaft nodes from the total number
of nodes ((2^(h+1) -1)-2^h



On Mon, Jun 7, 2010 at 10:53 PM, Anurag Sharma <anuragvic...@gmail.com>wrote:

> Can you expain  "edge of the tree". I could not get that.
>
> Anurag Sharma
>
>
>
> On Tue, Jun 8, 2010 at 5:53 AM, sharad kumar <aryansmit3...@gmail.com>wrote:
>
>> for placing police man we can use bellman ford bfs.or even make use of
>> topological sort.
>>
>>
>> On Mon, Jun 7, 2010 at 9:59 PM, divya <sweetdivya....@gmail.com> wrote:
>>
>>> consider a tree. policemen is to be placed such that for each edge of
>>> tree, there is a policeman on atleast one side of each edge. tell the
>>> min no. of policemen and their locatn in time O(n)
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algoge...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>>
>> --
>> yezhu malai vaasa venkataramana Govinda Govinda
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algoge...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
> --
>  You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to