我正在关注一些关于使用单独链接实现哈希表的手写笔记。特别是我正在寻找这个功能:
list<ListCell>::iterator TablaHash::FoundOnList(int key, int table_row){
for(list<ListCell>::iterator found= table[table_row].begin();
found != table[table_row].end();found++){
if((*found).Key() == key){
return found;
}
}
return Ø;
}
其中最后一个符号是空集。我知道我应该在那里返回一个“空”迭代器,但我该怎么办?也许返回 end() 迭代器?