开发者

Help with Btree homework

开发者 https://www.devze.com 2022-12-29 16:59 出处:网络
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):

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):

  1. The B-Tree page number
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号