B + tree C ++CodeRelease
Code: http://bluedog.download.csdn.net
Nothing can be said. The implementation of the C ++ template of the B + tree needs to be noted that
1. The key word of the master node is at the end of each leaf node.
2. Vals in a leaf node is not a set of values, but a set of value pointers, mainly to reduce the copy time during moving.
We also wanted to use keys as a collection of pointers, but there was a problem. If it was used as a database index, it had to read multiple pages.
Of course, keys is a value set and there will also be problems. For strings as keys, there will be an object copy problem.
Therefore, I think we need to implement two types of B + trees: value set and value pointer set,
Interested friends can discuss this, mail to xtlxs1976@163.com
3,AlgorithmThe book says that the B + tree is simpler than the B-tree, And it thinks that the deleted key can still be kept in the trunk. I think it may be used
Disk or database index management is reasonable, but as a complete algorithm, B + tree is much more complex than B-tree. For example, there are eight adjustments after deleting a key, b-trees only need to consider four types.
I was looking for a lot of data to test and started to write qqwry. there are about more than 0.3 million records in the latest version of the DAT conversion code, that is, the pure IP address database popular on the Internet. After writing the code, I found that the B + tree I wrote is of the value type, if the string is used as the key, it will be very slow and will not be tested. However, the conversion code of qqwry. dat is still very useful. In this rarfile, you can use what you need.
Well, it's still the same. If you find a bug or you areProgramThis class is used. Please send me a mail!