HashMap 和字典 ADT 之间的区别 [英] Difference between a HashMap and a dictionary ADT
问题描述
Hash Map 和字典 ADT 有什么区别.什么时候更喜欢一个.对于我的编程作业,我的老师要求使用其中之一,但我认为两者之间没有任何区别.该程序应该与一个巨大的不工作.的字符串.有什么建议吗?
What is the difference between a Hash Map and dictionary ADT. And when to prefer one over another. For my programming assignment my instructor has asked to use one of them but I don't see any difference in between both. The program is supposed to work with a huge no. of strings. Any suggestions?
推荐答案
就Java而言,HashMap
类和Dictionary
类都是实现
In terms of Java, both the class HashMap
and the class Dictionary
are implementations of the "Map" abstract data type. Abstract data types are not specific to any one programming language, and the Map ADT can also be known as a Hash, or a Dictionary, or an Associative Array (others at http://en.wikipedia.org/wiki/Associative_array). (Notice we're making a distinction between the Dictionary
class and the Dictionary ADT.)
Dictionary
class 已经被标记为过时,所以最好不要使用它.
The Dictionary
class has been marked as obsolete, so it's best not to use it.
这篇关于HashMap 和字典 ADT 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!