字典或数组 [英] Dictionary or Array
本文介绍了字典或数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
这些是两种不同类型的容器。 Array是一个顺序数据存储,您可以通过索引检索元素。字典是通过名称检索元素的哈希。两者都有优缺点(查找速度,插入时间,枚举等)。
请阅读通用Array vs Hash。
In what situation does it make sense to use a dictionary versus a NSMutableArray?
解决方案
Those are 2 different types of containers. Array is a sequential data storage where you can retrieve elements by index. Dictionary is a hash where you retrieve elements by "names". Both have pros and cons (lookup speed, insertion time, enumeration, etc).
Please read on generic Array vs Hash.
这篇关于字典或数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文