Re: How can i implements a class like an HashMap but with 2 keys ?
- From: Gordon Beaton <n.o.t@xxxxxxxxx>
- Date: 29 Aug 2007 13:24:31 GMT
On Wed, 29 Aug 2007 06:10:46 -0700, Patricia Shanahan wrote:
Roedy Green wrote:
3. concatenate your two String keys into one.
I'd avoid this one unless there is at least one char bit pattern
that cannot appear in the first input, to use as separator.
Why is it necessary to separate them? The cost of not doing so is only
an increased risk of collisions.
In fact that cost might be zero or so negligible that adding the
separator at each operation costs more than the potential collisions
it attempts to avoid.
I'm assuming that the concatenation is only used internally in the
HashMap, and that the separate components are used elsewhere in their
original, separate state.
/gordon
--
.
- Follow-Ups:
- Re: How can i implements a class like an HashMap but with 2 keys ?
- From: Roedy Green
- Re: How can i implements a class like an HashMap but with 2 keys ?
- From: Gordon Beaton
- Re: How can i implements a class like an HashMap but with 2 keys ?
- From: Patricia Shanahan
- Re: How can i implements a class like an HashMap but with 2 keys ?
- References:
- How can i implements a class like an HashMap but with 2 keys ?
- From: Rob
- Re: How can i implements a class like an HashMap but with 2 keys ?
- From: Roedy Green
- Re: How can i implements a class like an HashMap but with 2 keys ?
- From: Patricia Shanahan
- How can i implements a class like an HashMap but with 2 keys ?
- Prev by Date: Re: How can i implements a class like an HashMap but with 2 keys ?
- Next by Date: Re: Wipe utility
- Previous by thread: Re: How can i implements a class like an HashMap but with 2 keys ?
- Next by thread: Re: How can i implements a class like an HashMap but with 2 keys ?
- Index(es):
Relevant Pages
|