?
Solved

How to write this C program for B-trees??? (URGENT)

Posted on 2001-06-21
7
Medium Priority
?
297 Views
Last Modified: 2010-04-15
My brother needs to solve this problem until the end of this day, so please give it a quick look and let me know if you can solve it. Send the solution later in the day. I WILL AWARD  800 points to the person that will give me a working solution.

The problem has to do with implementing b-trees (I don't know what this is), and implementing them in C. The problem goes like this:

Target of this exercise is to create a primary index (B+-tree) on a file.

The program should ask the user for a physical name of a file, that will have the following contents:

card_id char[7]
last_name char[20]
salary integer
nationality char[20]

It will ask the user for the class of the primary index (up to 8) and the max. number of keys on the terminals (up to 12). Then, it will create a secondary index for the field named nationality (this will also be a B+-tree) for which it will ask again for the class, from the user.

Then the following actions should be programmed:

1. Entering a record
2. Deleting a record
3. Questioning using primary key
4. Questioning using the secondary key (by giving a value find the records, OR by giving a range of values, find the records belonging to it).

This exercise should run on SUN and it is preferred that the gcc compiler is used. I do not need fancy graphics, etc, just a file that works...

Thanks for trying. Just let me know first whether you can do it, and send the solution later, taking your time (I need it by afternoon, 5pm UK time).

GM
0
Comment
Question by:poutses
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 

Expert Comment

by:johnbrewer1980
ID: 6217357
hey sorry, but that sounds way too much like homework.

We're not supposed to help you there.
0
 

Author Comment

by:poutses
ID: 6217367
yes it sounds like homework and it is homework. If somebody can help that's fine, or else I will have to delete the question, or shouldn't I?
0
 

Expert Comment

by:johnbrewer1980
ID: 6217393
I think that pushing in the right direction is allowed, but no firm answers.  If this is no good, then don't expect any answers.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:poutses
ID: 6217689
Ok, then,

how can I implement the  mechanism that will ask the user for a file that has the fields described before, and then create the b+ tree??? This is my main question.

And then if possible, some hints on how to enter a record, (a line in the b+ tree) and then make questions, like giving a key value and finding the record?

Thanks
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 900 total points
ID: 6218788
Of course, I can't make your/your brother homework, but next is list of URL, where you can find theory/code
of B+ trees(from my bookmarks):
http://tardis.union.edu/~hedrickj/CSC148
This is actual pascal code (there is also C code there)
ftp://sunsite.dcc.uchile.cl/pub/users/rbaeza/handbook/algs/3
all sources for inserting/searching... on B+ trees in pascal.

http://www.ee.uwa.edu.au/~plsd210/ds/trees.html
http://enteract.com/~bradapp/ftp/src/libs/C++/AvlTrees.html

B Tree Development Tool:
http://members.aol.com/gcsfabs/dos_16i/e5mspas.htm

0
 

Author Comment

by:poutses
ID: 6220813
Is there a newsgroup about implementing B+ trees or something similar?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question