Link to home
Start Free TrialLog in
Avatar of kishore_peddi
kishore_peddi

asked on

Data Structures in VB.NET 2003 / 2005 !!

Hi,

I have the following objects:

1. ArrayList
2. SortedList
3. Stack
4. Queue
5. HashTable
6. ListDictionary
7. HybridDictionary
8. OrderedDictionary
9. NameValueCollection
10.BitArray
11.StringCollection
12.StringDictionary

I want to divide them into categories...Here are they

1. ICollection
2. IList
3. IDictionary

Can you please divide the objects into the above categories ? Advance thanks for your time & patience.

Thanks
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

IList and IDictionary inherit from ICollection for a start, so you'll have problems categorizing them like that.

Is this homework?
Avatar of kishore_peddi
kishore_peddi

ASKER

Hi webtubbs,

Thanks for asking me. This is NOT home work. I came across in one book. They have divided into 3 categories. I have also got the same doubt like you regarding that :) That is the reason i have posted this on EE. I thought that that is on top of my head. If you want i will give you the book name !!

Thanks
Hi webtubbs,

If you want i will post what was written there in that book and how they have categorized. Still i am NOT satified with the way they have written !! Please try to understand.

Thanks
kishore_peddi,

OK, I understand. How did they categorize them in the book?

Wayne
Hi webtubbs,

Here is what i have got from the book:

Collections :-

1. ICollection (Stack, Queue)
2. IList (ArrayList)
3. IDictionary (HashTable, SortedList)

Something interesting :)

This is what MSDN has to say....

Classes that Implement ICollection

     ArrayList
     BitArray
     Hashtable
     HybridDictionary
     Queue
     SortedList
     Stack
     StringCollection

Classes that implement IList

     ArrayList
     StringCollection

Classes that implement IDictionary

     Hashtable
     HybridDictionary
     ListDictionary
     OrderedDictionary
     SortedList

As you can see, there a few that implement a couple different classes. I do kinda understand how they've categorized them though. A Stack only implements ICollection, an ArrayList is realy a list, and a HashTable uses Key/Value pairs, so belongs to IDictionary.

Regards,

Wayne

mmm...I have carefully gone through the book once again. Here is a little bit word i have missed from the whole sentance. THEY ARE BASED ON PRIMARY INTERFACE THEY IMPLEMENT. Now can you please categorize them ?

Sorry for my mis-understand. Over-looked a single word (Primary Interface).

Thanks
I'd categorize them like this, if we are using the Primary interface as the category...

- ICollection

     BitArray
     Queue
     Stack
     StringCollection

- IList

     ArrayList
     StringCollection

- IDictionary

     Hashtable
     HybridDictionary
     ListDictionary
     OrderedDictionary
     SortedList
     StringDictionary
SortedList comes under IDictionary ? Just curious....
webtubbs,

Good to see your list. BUT i still do not know SortedList comes under IDictionay or NOT !! Can you verify it once again ?

Thanks
I'd categorize them like this, if we are using the Primary interface as the category...

- ICollection

     BitArray
     Queue
     Stack
     StringCollection

- IList

     ArrayList
     StringCollection

- IDictionary

     Hashtable
     HybridDictionary
     ListDictionary
     OrderedDictionary
     SortedList
     StringDictionary

And we have repeated      

StringCollection

twice !! Can we please look into this ?
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SortedList does belong in IDictionary. It uses Key/Value pairs.

All this information is be available in MSDN.