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
Post a Comment