Help with Btree homework
I need to do a preorder traversal of a Btree, and among other things, print the following information for each page (which is the same thing as a node):
- The B-Tree page number
- The value of each B-Tree page pointer (e.g., address, byte offset, RRN).
My questions are: 1. How do you figure out the byte offset? What is it offset from? 2. Isn't the RRN the same as the page number?
Note: A Btree is NOT A BINARY TR开发者_StackOverflowEE. Btrees can have multiple keys in each node, and a node with n keys has n+1 child pointers.
The byte offset is probably the offset of the record from the beginning of the page.
I think the RRN is the relative record number. So if a record is the 5th record in the page, its RRN would be 5.
You need to know the page layout to know how to interpret the information in a page/node. Many solutions are possible.
What code do you have to write, and what code is given to you? I need to know more about exactly what the assignment is asking you to do before I can be of any more help.
精彩评论