Basically, I just need an efficient way to store and retrieve keys from a
list. I don't need key/value pairs. I've implemented this with the standard
HashTable, but the value column is a waste since every key has the same
value, "".

Thanks for your advice.

- Joe Geretz -

Re: Any such thing as a single column HashTable? by Kevin

Kevin
Thu Mar 22 12:02:01 CDT 2007

Array of strings?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
Networking Components, Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Joseph Geretz" <jgeretz@nospam.com> wrote in message
news:%23ZQYOMKbHHA.1296@TK2MSFTNGP02.phx.gbl...
> Basically, I just need an efficient way to store and retrieve keys from a
> list. I don't need key/value pairs. I've implemented this with the
> standard HashTable, but the value column is a waste since every key has
> the same value, "".
>
> Thanks for your advice.
>
> - Joe Geretz -
>



Re: Any such thing as a single column HashTable? by Jon

Jon
Thu Mar 22 12:08:15 CDT 2007

On Mar 22, 4:54 pm, "Joseph Geretz" <jger...@nospam.com> wrote:
> Basically, I just need an efficient way to store and retrieve keys from a
> list. I don't need key/value pairs. I've implemented this with the standard
> HashTable, but the value column is a waste since every key has the same
> value, "".

So basically you want a set, right? No, there's nothing built into the
framework. Normally people just use HashTable/Dictionary<K,V> and use
a dummy value.

Jon


Re: Any such thing as a single column HashTable? by Rad

Rad
Thu Mar 22 12:27:28 CDT 2007

On Thu, 22 Mar 2007 12:54:49 -0400, Joseph Geretz wrote:

> Basically, I just need an efficient way to store and retrieve keys from a
> list. I don't need key/value pairs. I've implemented this with the standard
> HashTable, but the value column is a waste since every key has the same
> value, "".
>
> Thanks for your advice.
>
> - Joe Geretz -

An array?
--
Bits.Bytes
http://bytes.thinkersroom.com

Re: Any such thing as a single column HashTable? by Joseph

Joseph
Thu Mar 22 12:26:54 CDT 2007

Hi Kevin,

> Array of strings?

Will this provide as efficient lookup as the HashTable?

Thanks,

- Joseph Geretz -

"Kevin Spencer" <unclechutney@nothinks.com> wrote in message
news:O858PPKbHHA.4220@TK2MSFTNGP03.phx.gbl...
> Array of strings?
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
>
> Printing Components, Email Components,
> Networking Components, Controls, much more.
> DSI PrintManager, Miradyne Component Libraries:
> http://www.miradyne.net
>
> "Joseph Geretz" <jgeretz@nospam.com> wrote in message
> news:%23ZQYOMKbHHA.1296@TK2MSFTNGP02.phx.gbl...
>> Basically, I just need an efficient way to store and retrieve keys from a
>> list. I don't need key/value pairs. I've implemented this with the
>> standard HashTable, but the value column is a waste since every key has
>> the same value, "".
>>
>> Thanks for your advice.
>>
>> - Joe Geretz -
>>
>
>



Re: Any such thing as a single column HashTable? by Nicholas

Nicholas
Thu Mar 22 12:45:41 CDT 2007

It might be a little early, but there will be the HashSet class in Orcas
which will introduce this class. Just something to be aware of in the
future.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:1174583295.016401.78460@l77g2000hsb.googlegroups.com...
> On Mar 22, 4:54 pm, "Joseph Geretz" <jger...@nospam.com> wrote:
>> Basically, I just need an efficient way to store and retrieve keys from a
>> list. I don't need key/value pairs. I've implemented this with the
>> standard
>> HashTable, but the value column is a waste since every key has the same
>> value, "".
>
> So basically you want a set, right? No, there's nothing built into the
> framework. Normally people just use HashTable/Dictionary<K,V> and use
> a dummy value.
>
> Jon
>



Re: Any such thing as a single column HashTable? by Jon

Jon
Thu Mar 22 12:53:33 CDT 2007

Nicholas Paldino [.NET/C# MVP] <mvp@spam.guard.caspershouse.com> wrote:
> It might be a little early, but there will be the HashSet class in Orcas
> which will introduce this class. Just something to be aware of in the
> future.

Hurrah! Only 5 years after it should have been present :)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Re: Any such thing as a single column HashTable? by pbromberg

pbromberg
Thu Mar 22 15:16:13 CDT 2007

I can't wait. :-)
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




"Nicholas Paldino [.NET/C# MVP]" wrote:

> It might be a little early, but there will be the HashSet class in Orcas
> which will introduce this class. Just something to be aware of in the
> future.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> news:1174583295.016401.78460@l77g2000hsb.googlegroups.com...
> > On Mar 22, 4:54 pm, "Joseph Geretz" <jger...@nospam.com> wrote:
> >> Basically, I just need an efficient way to store and retrieve keys from a
> >> list. I don't need key/value pairs. I've implemented this with the
> >> standard
> >> HashTable, but the value column is a waste since every key has the same
> >> value, "".
> >
> > So basically you want a set, right? No, there's nothing built into the
> > framework. Normally people just use HashTable/Dictionary<K,V> and use
> > a dummy value.
> >
> > Jon
> >
>
>
>

RE: Any such thing as a single column HashTable? by pbromberg

pbromberg
Thu Mar 22 15:19:18 CDT 2007

How about a StringDictionary?
http://msdn2.microsoft.com/en-us/library/system.collections.specialized.stringdictionary_members.aspx

It still has that nasty Value member, but its strongly typed and has the
nice convenience lookup methods.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




"Joseph Geretz" wrote:

> Basically, I just need an efficient way to store and retrieve keys from a
> list. I don't need key/value pairs. I've implemented this with the standard
> HashTable, but the value column is a waste since every key has the same
> value, "".
>
> Thanks for your advice.
>
> - Joe Geretz -
>
>
>

Re: Any such thing as a single column HashTable? by Joseph

Joseph
Thu Mar 22 15:21:57 CDT 2007

Hi Rad,

> An array?

Will this provide as efficient lookup as the HashTable?

Thanks,

- Joseph Geretz -

"Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message
news:4mwnai36wsnt$.dlg@thinkersroom.com...
> On Thu, 22 Mar 2007 12:54:49 -0400, Joseph Geretz wrote:
>
>> Basically, I just need an efficient way to store and retrieve keys from a
>> list. I don't need key/value pairs. I've implemented this with the
>> standard
>> HashTable, but the value column is a waste since every key has the same
>> value, "".
>>
>> Thanks for your advice.
>>
>> - Joe Geretz -
>
> An array?
> --
> Bits.Bytes
> http://bytes.thinkersroom.com



Re: Any such thing as a single column HashTable? by EmeraldShield

EmeraldShield
Thu Mar 22 16:57:48 CDT 2007

>
>> An array?
>
> Will this provide as efficient lookup as the HashTable?
>

No, HashTable is your fastest lookup hands down. Just put an INT in the
data with 0. Then you can just use the keys.




Re: Any such thing as a single column HashTable? by Jon

Jon
Thu Mar 22 17:05:00 CDT 2007

EmeraldShield <emeraldshield@noemail.noemail> wrote:
> No, HashTable is your fastest lookup hands down. Just put an INT in the
> data with 0. Then you can just use the keys.

Using a plain HashTable, that's a really bad idea - the 0 would get
boxed every time. Using something like "" or even making the key also
the value is more efficient.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Re: Any such thing as a single column HashTable? by Joseph

Joseph
Thu Mar 22 17:24:51 CDT 2007

Thanks Jon,

I've been using "" for the value.

- Joe Geretz -

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.206d0de5c0a95f6998da01@msnews.microsoft.com...
> EmeraldShield <emeraldshield@noemail.noemail> wrote:
>> No, HashTable is your fastest lookup hands down. Just put an INT in the
>> data with 0. Then you can just use the keys.
>
> Using a plain HashTable, that's a really bad idea - the 0 would get
> boxed every time. Using something like "" or even making the key also
> the value is more efficient.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too



Re: Any such thing as a single column HashTable? by Kevin

Kevin
Fri Mar 23 07:35:38 CDT 2007

> Will this provide as efficient lookup as the HashTable?

What are you trying to look up?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
Networking Components, Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Joseph Geretz" <jgeretz@nospam.com> wrote in message
news:uCXGR$LbHHA.3616@TK2MSFTNGP05.phx.gbl...
> Hi Rad,
>
>> An array?
>
> Will this provide as efficient lookup as the HashTable?
>
> Thanks,
>
> - Joseph Geretz -
>
> "Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message
> news:4mwnai36wsnt$.dlg@thinkersroom.com...
>> On Thu, 22 Mar 2007 12:54:49 -0400, Joseph Geretz wrote:
>>
>>> Basically, I just need an efficient way to store and retrieve keys from
>>> a
>>> list. I don't need key/value pairs. I've implemented this with the
>>> standard
>>> HashTable, but the value column is a waste since every key has the same
>>> value, "".
>>>
>>> Thanks for your advice.
>>>
>>> - Joe Geretz -
>>
>> An array?
>> --
>> Bits.Bytes
>> http://bytes.thinkersroom.com
>
>



Re: Any such thing as a single column HashTable? by Brian

Brian
Fri Mar 23 11:44:02 CDT 2007

On Mar 22, 12:45 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> It might be a little early, but there will be the HashSet class in Orcas
> which will introduce this class. Just something to be aware of in the
> future.
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - m...@spam.guard.caspershouse.com
>

I was not aware of that until now. I'm guessing it'll have union,
intersection, difference, etc. methods? That would be nice. Thanks
for the tip.