List
_蒹葭苍苍
Everyone has his own dreams.My dream is to be a computer programmer.I think it's very interesting and exciting for me to work on.With the development of science and technology,people can imagin and swim freely in the world ofcomputers.Computers have become good partners and friends in the daily life
展开
-
List、Set、Map是否继承自Collection接口?
List、Set 是,Map 不是。 Map是键值对映射容器,与List和Set有明显的区别,而Set存储的零散的元素且不允许有重复元素(数学中的集合也是如此),List是线性结构的容器,适用于按数值索引访问元素的情形。...原创 2018-10-18 20:20:58 · 414 阅读 · 0 评论 -
List、Map、Set三个接口存取元素时,各有什么特点?
List以特定索引来存取元素,可以有重复元素。Set不能存放重复元素(用对象的equals()方法来区分元素是否重复)。Map保存键值对(key-value pair)映射,映射关系可以是一对一或多对一。Set和Map容器都有基于哈希存储和排序树的两种实现版本,基于哈希存储的版本理论存取时间复杂度为O(1),而基于排序树版本的实现在插入或删除元素时会按照元素或元素的键(key)构成排序树从而达到排...原创 2018-10-19 08:57:35 · 788 阅读 · 0 评论