如何快速手写一个属于自己的hashmap(简化版)
不多说 直接上代码
package chn.xx.com.hashmap;
public class ChnHashMap {
//简单实现,故不实现红黑树,resize扩容方法。
//固定数组
private Node[] nodes = new Node[10000];
//获取数组索引方法
private int getindex(int key){
//计算key的hash值
int hash = Integer.hash
原创
2021-09-10 15:34:21 ·
141 阅读 ·
0 评论