HashMap和字典ADT之间的区别 [英] Difference between a HashMap and a dictionary ADT

查看:350
本文介绍了HashMap和字典ADT之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哈希地图和字典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 并且Map抽象数据类型的类字典实现。抽象数据类型不是特定于任何一种编程语言,而Map ADT也可以被称为哈希,或字典或关联数组(其他在 http://en.wikipedia.org/wiki/Associative_array )。 (请注意,我们正在区分词典类和词典ADT。)

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.)

字典 已被标记为已过时,所以最好不要使用它。

The Dictionary class has been marked as obsolete, so it's best not to use it.

这篇关于HashMap和字典ADT之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆