Dictionary vs. hashtable -


can explain difference between dictionaries , hashtables? in java, i've read dictionaries superset of hashtables, thought other way around. other languages seem treat 2 same. when should 1 used on other, , what's difference?

the oxford dictionary of computing defines dictionary as...

any data structure representing set of elements can support insertion , deletion of elements test membership.

as such, dictionaries abstract idea can reasonably efficiently implemented e.g. binary trees or hash tables, tries, or direct array indexing if keys numeric , not sparse. said, python uses closed-hashing hash table dict implementation, , c# seems use kind of hash table (hence need separate sorteddictionary type).

a hash table more specific , concrete data structures: there several implementations options (closed vs. open hashing being perhaps fundamental), they're characterised o(1) amortised insertion, lookup , deletion, , there's no excuse begin->end iteration worse o(n + #buckets), while implementations may achieve better (e.g. gcc's c++ library has o(n) container iteration. implementations depend on hash function leading indexed probe in array.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -