We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
哈希表rebuild的时候为什么指针每一个都去移动一遍,只需要把头指针变更一下就可以了 应该。 for (TableEntry** oldChainPtr = oldBuckets; oldSize > 0; --oldSize, ++oldChainPtr) { for (TableEntry* hPtr = *oldChainPtr; hPtr != NULL; hPtr = *oldChainPtr) { *oldChainPtr = hPtr->fNext;
unsigned index = hashIndexFromKey(hPtr->key); hPtr->fNext = fBuckets[index];//插入在前面的单链表 fBuckets[index] = hPtr; }
} 这段是否可以改成 int i = 0 ; for (TableEntry** oldChainPtr = oldBuckets; i < oldSize; ++i, ++oldChainPtr) { fBuckets[i ]=*oldChainPtr; }
The text was updated successfully, but these errors were encountered:
English please?
Sorry, something went wrong.
No branches or pull requests
哈希表rebuild的时候为什么指针每一个都去移动一遍,只需要把头指针变更一下就可以了 应该。
for (TableEntry** oldChainPtr = oldBuckets; oldSize > 0;
--oldSize, ++oldChainPtr) {
for (TableEntry* hPtr = *oldChainPtr; hPtr != NULL;
hPtr = *oldChainPtr) {
*oldChainPtr = hPtr->fNext;
}
这段是否可以改成
int i = 0 ;
for (TableEntry** oldChainPtr = oldBuckets; i < oldSize;
++i, ++oldChainPtr) {
fBuckets[i ]=*oldChainPtr;
}
The text was updated successfully, but these errors were encountered: