CSE 326 Section I

B+ Tree

4/20/00

This handout tells you how to start a huge project like the B+ Tree. Better yet, it helps you save countless painful hours of debugging.

  1. Fully understand the tasks. What are the input and output? Read the instruction carefully.
  2. Read the algorithms handouts. Make sure you understand each step. Ask Karen or Gerome if you get stuck.
  3. Design your data structure. Draw something on paper, don’t just imagine it in your head.
    1. Define your classes. Can you modularize the B+ Tree into smaller structure?
    2. What are the member functions of each class? What is the input and output of each member function?
    3. What are the data members of each class? Just give a rough design cause you will always think of other things latter.
    4. How do different classes work together? Do the data types match?
  4. Write the header file first. It shouldn’t take long if you have a good design at step 3. Just translate the pretty picture into prettier C++ code.
  5. Write the source code. Don’t start out with the main function like a 142 student. Tackle one class at a time. The algorithm handouts should be your guideline. Modify your definition if necessary. Test right after you finish each module. Make sure each small part works before you put them all together. Waiting until the last moment to debug is the worst strategy.
  6. Use some simple data to test your B+ tree. You can hard-code some insertions and then search for those records. Start out with order 2.
  7. Complete your code by linking it to the database. Make a good use of the tools we offered.
  8. Think of the extra credits if you haven’t gone crazy, or if you are crazy already.