Re: On the complexity of determining whether n numbers are distinct
- From: "eKo1" <berndlosert@xxxxxxxxxxxx>
- Date: 25 Sep 2006 05:41:45 -0700
goanna wrote:
Technically correct, perhaps, but all a bit silly really.
You've just replaced pairwise comparisons with increments,
comparisons to zero, and decrements, which all still need
to be counted. As your vector needs to be as large as the
largest number k, which may be very much larger than n,
the number of comparisons to zero may be much larger than
the number of pairwise comparisons you've eliminated.
Yes, that is very true. I didn't think of that. So the time complexity
is now bounded by the size of the vector which is the size of the
largest number k rather than by n.
.
- References:
- On the complexity of determining whether n numbers are distinct
- From: eKo1
- Re: On the complexity of determining whether n numbers are distinct
- From: Markus Triska
- Re: On the complexity of determining whether n numbers are distinct
- From: eKo1
- Re: On the complexity of determining whether n numbers are distinct
- From: Markus Triska
- Re: On the complexity of determining whether n numbers are distinct
- From: Patricia Shanahan
- Re: On the complexity of determining whether n numbers are distinct
- From: goanna
- On the complexity of determining whether n numbers are distinct
- Prev by Date: Re: On the complexity of determining whether n numbers are distinct
- Next by Date: Re: On the complexity of determining whether n numbers are distinct
- Previous by thread: Re: On the complexity of determining whether n numbers are distinct
- Next by thread: Re: On the complexity of determining whether n numbers are distinct
- Index(es):