b-tree

saving Btrees to a disk file and read it

随声附和 提交于 2019-11-26 16:29:33
问题 I want to save a Btree(not sure a binary one) in a disk file. and then read it to the memory. some Level-order traversal may be a good way for a binary Btree. but if it is not a binary one. I build up the Btree from the leafnode to the rootnode in memory. I believe that I have to define some structures in the disk file and output the tree nodes. using some extra tag to identify a node in the file? how to traversal may be the key problem here. I coudn't figure out a good way to save the nodes

Segmentation fault in btree implementation

走远了吗. 提交于 2019-11-26 12:49:19
问题 Can anyone please help in removing this segmentation fault. I am working on this code for a week still unable to debug this. This code is a Btree implementation. The insertion part is working properly but there is an segmentation fault in deletion. I am unable to debug it, can anyone please help? I have given the input based on this link (have converted alphabet value to ASCII value) http://cis.stvincent.edu/html/tutorials/swd/btree/btree.html When I delete the first H (equivalent ASCII value