地图和词典有什么区别? [英] What is the difference between a Map and a Dictionary?

查看:139
本文介绍了地图和词典有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

地图字典之间有什么区别?我不是要求他们在语言X或Y中定义它们(这似乎是SO在这里一般人都在问的),我想知道他们在理论上有什么区别。

What is the difference between a Map and a Dictionary? I am not asking for how they are defined in language X or Y (which seems to be what generally people are asking here on SO), I want to know what is their difference in theory.

我知道一个 Map 是将键映射到值的对象。不是一个字典相同?他们有什么区别?

I know a Map is an object that maps keys to values. Isn't a Dictionary the same? What distinguishes them?

推荐答案

同一件事的两个术语

Java,C ++使用的地图

Dictionary由.Net,Python使用

关联数组被JavaScript使用,PHP

"Map" is used by Java, C++
"Dictionary" is used by .Net, Python
"Associative array" is used by Javascript, PHP

Map是正确的数学术语,但是避免了它在功能性编程中有不同的含义。

"Map" is the correct mathematical term, but it is avoided because it has separate meaning in functional programming.

请参阅此处

这篇关于地图和词典有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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