.
This commit is contained in:
36
bac1/q2/algo/hashmap/HashMap.java
Normal file
36
bac1/q2/algo/hashmap/HashMap.java
Normal file
@ -0,0 +1,36 @@
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class HashMap {
|
||||
LinkedList<HashEntry>[] tab;
|
||||
Iterator iter;
|
||||
|
||||
class HashEntry{
|
||||
public Object key, value;
|
||||
}
|
||||
|
||||
class MyHashMapIterator implements Iterator{
|
||||
int i;
|
||||
|
||||
public MyHashMapIterator(){
|
||||
while(i<tab.length){
|
||||
if(tab[i] == null)
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
if(i >= tab.length)
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object next() {
|
||||
}
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user