Secondary keys in a B-tree

Posted by Phenom on Stack Overflow See other posts from Stack Overflow or by Phenom
Published on 2010-05-08T07:45:55Z Indexed on 2010/05/08 7:48 UTC
Read the original article Hit count: 200

Filed under:

Let's say that there is a file that contains an unsorted list of student information, which includes a student ID number as well as other information.

I want to make a program that retrieves student information based on student ID number. In order to make it efficient, I store the student IDs in a B-tree.

So when I enter a student ID number, it searches the B-tree to see if its there or not. It also does one more thing. If it finds the student ID number, then it also returns where in the file that student's information is. This is the secondary key. The program uses this information to locate the rest of the student's information and prints it to screen.

Can this be done? Is this how a b-tree works?

© Stack Overflow or respective owner

Related posts about btree