8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
作者您好!代码里写到:
if(where == end(parent) - 1){ // if leaf is last element then merge : | prev | leaf | -> | prev leaf | assert(leaf.prev != 0); leaf_node_t prev; map(&prev,leaf.prev); index_key = begin(prev)->key; //此处为什么是begin(prev)->key? merge_leafs(&prev,&leaf);//数据结构层面合并 node_remove(&prev,&leaf);//物理层面合并(用到了map/unmap) unmap(&prev,leaf.prev);//修改了prev,要回写 } else { assert(leaf.next!=0); leaf_node_t next; map(&next,leaf.next); index_key = begin(leaf)->key; //此处为什么是begin(leaf)->key? merge_leafs(&leaf,&next); node_remove(&leaf,&next); unmap(&leaf,offset); }
合并两个节点后,要删除原本分隔两个节点的键,而这个键应该是取右边节点的最小值或者其它合适的值?不太理解为什么反而取第一个节点最前面的键,还望指教。 谢谢
The text was updated successfully, but these errors were encountered:
No branches or pull requests
作者您好!代码里写到:
合并两个节点后,要删除原本分隔两个节点的键,而这个键应该是取右边节点的最小值或者其它合适的值?不太理解为什么反而取第一个节点最前面的键,还望指教。
谢谢
The text was updated successfully, but these errors were encountered: