[Mono-devel-list] Implemented Dictionary<K,V>

Ankit Jain radical at gmail.com
Mon Feb 28 06:15:38 EST 2005


Attached is an implementation of Generic Dictionary coded by Suresh and I.

Regards,
Ankit


On Sun, 27 Feb 2005 12:56:51 -0500 (EST), Ben Maurer <bmaurer at ximian.com> wrote:
> >
> > ----- Original Message -----
> > From: "Ben Maurer" <bmaurer at ximian.com>
> > To: "Matthijs ter Woord (meddochat)" <meddochat at zonnet.nl>
> > Cc: <mono-devel-list at ximian.org>
> > Sent: Sunday, February 27, 2005 5:35 PM
> > Subject: Re: [Mono-devel-list] Implemented Dictionary<K,V>
> >
> >
> >> On Sun, 2005-02-27 at 10:14 +0100, Matthijs ter Woord (meddochat)
> >> wrote:
> >> > Hi Everybody,
> >> >
> >> > I implemented Dictionary<K,V>, can someone take a look at it?
> >>
> >> + public V this[K Index]{
> > ....
> >> + }
> >>
> >> This is a linear search. The Dictionary needs to be implemented like
> > Hashtable.
> >>
> >
> > Hmm, That's to much magic to me. Why didn't somebody else it already?
> 
> Because nobody has bothered.
> 
> Honestly, its not all that hard. For a first impl, we could do one of the
> easier ways of resolving hash conflicts (like a linked list, rather than
> the stuff we have in Hashtable, which is a bit harder).
> 
> > System.Collections.Generic seems important for Fx 2.0 stuff to me.
> 
> But given that it is not all that hard, it would be good to get at least a
> reasonable impl the first time.
> 
> One other idea, if you really want the cheap way out, is to use Hashtable
> and just do casting. It will box struct types and cost extra casting for
> ref types. However, it at least gives a reasonable case for the ref types,
> and a case that scales fairly well on value types.
> 
> -- Ben
> 
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dictionary.patch
Type: text/x-diff
Size: 34086 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050228/95374acd/attachment.bin 


More information about the Mono-devel-list mailing list