当前位置:网站首页>The division principle summary within the collection
The division principle summary within the collection
2022-08-09 06:32:00 【The strongest disciple in history】
ArrayList
1. Constructor
new Arraylist(size)
if size ==0 {}
else if size>0 new Object[size];
2. default CAPACITY 10
Expansion:
1. Construct method to expand
2. Add grow method 1.5 times.
HashSet
1. Constructor
Math.max((int) (c.size()/.75f) + 1, 16) 16 or size/0.75 +1 This is for discrete distribution.
2. The bottom layer is the hashmap structure map.put(e, PRESENT);
HashMap
1. The auto-increment factor is 0.75
2. The default capacity is 16 When the number of elements in the HashMap exceeds the capacity * loading factor, the HashMap will expand the capacity
Hash methods to avoid conflicts:
1. Open address method: The open address method is to find the next empty hash address once a conflict occurs, as long as the hash table is large enough, the empty hashThe column address is always found and the record is stored.
2. Re-hash method: If the address conflicts, perform the address and re-hash.
3. Chain address method: The node of the array extends the external node into a linked list structure.
rehash()
0.75*size()
When the number of entries in the hash table exceeds the product of the load factor and the current capacity, and the location to be stored already has elements (hashcollision), two conditions must be met to expand the capacity.
2x the growth
ConcurrentHashMap
put 方法加锁锁的对象是hash 数组的node。
The get method is not locked, volatile.
边栏推荐
- PDF不能打印和复制的问题如何解决?
- Introduction of convenient functions and convenient shortcut keys of vs tomato assistant
- 中英文说明书丨CalBioreagents 山羊抗人白蛋白,IgG组分
- Use baidu EasyDL intelligent bin
- 网络学习总结
- Silently start over, the first page is also a new page
- 运放-运算放大器经典应用电路大全-应用电路大全
- Altium designer软件常用最全封装库,包含原理图库、PCB库和3D模型库
- sql问题解答创建表的语句
- String.toLowerCase(Locale.ROOT)
猜你喜欢
深度学习-神经网络原理2
CMake中INSTALL_RPATH与BUILD_RPATH问题
Likou Brush Question 180
workbench 数据导出
治疗消化性溃疡—Toronto Research Chemicals 甘氨酸铝
Search 1688 product interface by image (item_search_img-search 1688 product by image (Politao interface) code docking tutorial
6 states of a thread
推进产教融合 赋能教育创新发展 | 华云数据荣获“企业贡献奖”
leetcode 之盛水问题
中英文说明书丨CalBioreagents 山羊抗人白蛋白,IgG组分
随机推荐
缓存技术使用
P6阿里机试题之2020 斐波那契数
Use baidu EasyDL intelligent bin
crc计算
Unity 五子棋游戏设计和简单AI(3)
6 states of a thread
[HNOI2002]营业额统计
Use of PlantUML plugin in idea
报错:FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disab
io.lettuce.core。RedisCommandTimeoutException命令超时
治疗消化性溃疡—Toronto Research Chemicals 甘氨酸铝
TCP segment of a reassembled PDU
IQ Products巨细胞病毒CMV感染检测试剂盒的特征和应用
报错:FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS重大开销和将disab补充道
XxlJobConfig分布式定时器任务管理XxlJob配置类,替代
String.toLowerCase(Locale.ROOT)
推进产教融合 赋能教育创新发展 | 华云数据荣获“企业贡献奖”
如何操作数据库
直接用的zip包 缺少很多依赖,pip没有,感觉用anaconda create一个环境会方便点
中英文说明书丨CalBioreagents ACTH N端单克隆抗体