Diff b/w data dictionary and hash table? [Resolved]

Posted by Hariinakoti under Interview Questions on 5/3/2012 | Points: 10 | Views : 1716 | Status : [Member] | Replies : 5
Hi,
waht is the Diff b/w data dictionary and hash table?

Thanks & Regards
Hari



Responses

Posted by: Sakthi.Singaravel on: 5/3/2012 [Member] Silver | Points: 50

Up
0
Down

Resolved
Dictionary

Dim dictionary As New Dictionary(Of String, Integer )


The above is example of Dictionary..
u can add new values as key->String and Value->Integer

Hashtable


Dim Hash_Table_Name As New Hashtable


In hash Table key and values are not considered data types..

ex for hash table.

Hash_Table_Name.Add("1","One")

Hash_Table_Name.Add("number","54766")


Regards,
Singaravel M

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/3/2012 [Member] Silver | Points: 25

Up
0
Down
Dictionary is used for specified type of variable...

Dim dictionary As New Dictionary(Of String, Integer )


But Hash Table we need not specify any data types, we store combine of all data types(int, string,...)

Dim AddHash As New Hashtable


Regards,
Singaravel M

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 5/3/2012 [Member] Starter | Points: 25

Up
0
Down
@sakthi
plz tell me clearly


Thanks & Regards
Hari

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/17/2012 [Member] Bronze | Points: 25

Up
0
Down
Dictionary

1)Dictionary is a generic type.
2)Dictionary public static members are thread safe, but any instance members are not guaranteed to be thread safe.
3)we can not use dictionary (generics) with web services.
3)Dictionary gives performance improvement while working with value types compared to hashtable
4)Dictionaty is always faster compare to ArrayList since it maintains indexes and also secure since data is encrypted..

Hashtable

1)Hashtable is not a generic type.
2) Hashtable is thread safe for use by multiple reader threads and a single writing thread.
3)HashTable stored data in form of DictionaryEntry class which holds key and value in form of object
4)Hashtable is an untyped associative container that uses DictionaryEntry class to return results of enumeration through its key-value pairs.

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/17/2012 [Member] Bronze | Points: 25

Up
0
Down
Please mark as answer if it helpful to you...That helps others who search the same..

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response