insert method
if(key already exist) count+1,also set data to newdata if(key not exist) if(not full) insert keyCount(data: data,count: 1) if(full) insert keyCount(data: data,count: minUseCount+1)
Implementation
void insert(String key,Map<String,dynamic> data){
if(map.containsKey(key)){ //// add count by 1 then bubble down
int i=1;
while(array[i]!=key){i++;}
map[key]!.add1();
map[array[i]]!.data=data;
bubbledown(i);
}else if(array.length<lmt){ /// add to bottom then bubble up
map[key]=keyCount(data: data);
int i=array.length;
array.add(key);
bubbleup(i);
}else{
final oldKey=array[1];
map[key]=keyCount(data: data,count: map[oldKey]!.count+1);
array[1]=key;
map.remove(oldKey);
bubbledown(1);
}
}