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

查看:13
本文介绍了HashMap 和字典 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类都是实现 .抽象数据类型并不特定于任何一种编程语言,Map ADT 也可以称为哈希、字典或关联数组(其他位于 http://en.wikipedia.org/wiki/Associative_array).(请注意,我们在 Dictionary 类和 Dictionary 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.)

Dictionary class 已经被标记为过时,所以最好不要使用它.

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

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

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