Re: A dictionary with many keys for the same value

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Your stated requirement appears contradictory since your example code
does in fact add two items. Do you mean that you want to "rewrite"
the key (from 0 to 11 in this case)? In that case the technique would
be to remove the item with key == 0, then add it back with key == 11.
This does of course add the item twice, however the resulting
collection.Count would be 1 as desired.

I think he was pretty clear. The example code adds the same item twice but with different keys. He wants the collection to contain two keys pointing to the same item so that the isn't a one-to-one relationship between a key and the item.

Best Regards,
Dustin Campbell
Developer Express Inc.


.



Relevant Pages

  • Re: PIC versus AVR
    ... assembly that I could improve enough to justify the effort to rewrite in ... Once or twice I changed a C expression for better assembly ... experience on AVR targets). ...
    (comp.arch.embedded)
  • Re: A dictionary with many keys for the same value
    ... Dustin Campbell wrote: ... Do you mean that you want to "rewrite" ... The example code adds the same item twice but with different keys. ... apparent contradiction in wanting the resulting dictionary to have a count of 1. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: HOLY SHIT!
    ... Well, if you were Barbra Streisand, you could recommend he rewrite it to ...
    (rec.arts.theatre.musicals)
  • Re: Random number question?
    ... Or the same individual number twice? ... Any electronic game player will tell you that if a good play is dealt then ... Since every developer using a random number generator knows to seed with the ... timer then there must be some hardware difficulty with the timer. ...
    (sci.math)
  • Re: Printed Documentation wirh Diamondback
    ... Rudy Velthuis [TeamB] wrote: ... > developer. ... At least twice a year, from beginning to end (and back, ...
    (borland.public.delphi.non-technical)