你这样的好处是什么呢?真的没看懂 我的理解就是一个数组,每个数组保存一个chain List> [] array= new LinkedList>[size]; hashtableIterator中hold一个 array, index(for the array),Iterator,V>> (for the list in each slot) 应该就可以了吧? 插入删除都是先找slot,然后对相应的list操作就可以了 hasNext(),next()的话都是先找current iterator.hasNext(), iterator.next() 如果没有的话,再去找下一个slot对应list的iterator
你这样的好处是什么呢?真的没看懂 我的理解就是一个数组,每个数组保存一个chain List> [] array= new LinkedList>[size]; hashtableIterator中hold一个 array, index(for the array),Iterator,V>> (for the list in each slot) 应该就可以了吧? 插入删除都是先找slot,然后对相应的list操作就可以了 hasNext(),next()的话都是先找current iterator.hasNext(), iterator.next() 如果没有的话,再去找下一个slot对应list的iterator