[algogeeks] Re: linked list questions

2009-08-13 Thread varun bhatia
well the 2nd ques is not clear. can u explain it in simpler manner On Wed, Aug 12, 2009 at 4:37 PM, Aravind Narayanan wrote: > > On Wed, Aug 12, 2009 at 10:38, varun bhatia wrote: > >> 1. Given a single link list with one info part containing single character >> and a

[algogeeks] Re: Number in set of intervals?

2009-08-13 Thread Geoffrey Summerhayes
On Aug 13, 5:49 am, Arthur Milfait wrote: > hi there, > > actually i am programming a software that loads numbers for radios in > a trunking system from a file and has to check each number if it is a > number for a group of radios. criterion to be the number of a > radiogroup is, that the numbe

[algogeeks] Re: Number in set of intervals?

2009-08-13 Thread Dave
>From the way you wrote the problem statement, it looks like you want a given radio number or maybe all radio numbers to be in all of the intervals. In that case, just form the intersection of the intervals, which will be an interval. Dave On Aug 13, 4:49 am, Arthur Milfait wrote: > hi there, >

[algogeeks] Re: Finding repeated element in most efficient way

2009-08-13 Thread ankur aggarwal
@angad read the ques carefully ... wat r u saying ??? try 2 explain .. On Thu, Aug 13, 2009 at 7:26 PM, Angad Karunan wrote: > why do you have to sort or do anything more if only one element repeats > itself? > just reading the array once shall give you the answer in O(n) time... > so i guess t

[algogeeks] Re: Finding repeated element in most efficient way

2009-08-13 Thread sharad kumar
how is it possible in O(N) sir,wen array unordered??if u prove it u shall be then next DONALD E KNUTH On Thu, Aug 13, 2009 at 7:26 PM, Angad Karunan wrote: > why do you have to sort or do anything more if only one element repeats > itself? > just reading the array once shall give you the answer i

[algogeeks] Re: Finding repeated element in most efficient way

2009-08-13 Thread Angad Karunan
why do you have to sort or do anything more if only one element repeats itself? just reading the array once shall give you the answer in O(n) time... so i guess there must be a solution better than O(n) time as the element repeats in a particular fashion. but cant think of anythin :P On Tue, Aug 1

[algogeeks] Re: Number in set of intervals?

2009-08-13 Thread sharad kumar
can u use a ssegment tree??? On Thu, Aug 13, 2009 at 3:19 PM, Arthur Milfait wrote: > > hi there, > > actually i am programming a software that loads numbers for radios in > a trunking system from a file and has to check each number if it is a > number for a group of radios. criterion to be the

[algogeeks] Number in set of intervals?

2009-08-13 Thread Arthur Milfait
hi there, actually i am programming a software that loads numbers for radios in a trunking system from a file and has to check each number if it is a number for a group of radios. criterion to be the number of a radiogroup is, that the number is within an interval from an including lower limit to

[algogeeks] Re: Constraint 3-Coloring --- P or NP-Complete ?

2009-08-13 Thread Miroslav Balaz
Ok your question have some little catch hidden. But first let me was the question. Does each vertex has at least one forbiden color? because if you can have no forbiden colors you end up with clasical 3-coloring problem which is NP-Complete. The catch is that if P=NP then everything nontrivial is