This is a HW assignment in preparation of review for the Final Exam that covers Buildheap, Heapsort, Dijkstra's and Prim's Algorithm

Solutions to a HW assignment: Examples of Buildheap, Heapsort, Dijkstra's, and Prim's Algorithm

For Dijkstra's Shortest Path Algorithm, check out the following web site with "cool" simulations! http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/dijkstra/Dijkstra.html

Here is a link to a full trace of Kruse's B Tree delete function (for e.g. covered in class:

Here is a link to a full trace of Kruse's B Tree insert function (for e.g. covered in class:

For 151 - Summary Notes on B* trees:

For Inserts- The idea is to delay splits until right sibling and your node are both full.  For root nodes on an order 9 tree, full is when the root has 10 data values, for non-roots, full is when the node has 8 data elements.  Root splits are 1 into 2 node splits, all other splits are 2 to 3 node splits.  Since you are delaying splits, you may need to use move_right or move_left, and you may need these at levels in the tree HIGHER  than the leaf level.

For Deletes - The idea is to delay combines here.  Combines at the level just below and including the root will be a 2 nodes combine into 1 combine.  Levels below this will be a 3 nodes combine into 2 combine.  If the node that is now below the minimum has a sibling on both the right and left, these are the nodes to combine with.  If either of these nodes has "room to borrow" from, then use move_right or move_left to delay the combine as long as possible.  If you are at a leftmost sibling, then use the 2 nodes immediately to the right to borrow from or combine with.  If you are at the rightmost sibling, then use the 2 nodes immediately to the left.  Combines of 3 nodes to 2 will always involve 3 nodes that have all fallen to the level of having only 5 data values and a new delete has caused one of these to fall to only 4.  Combines of 2 nodes into 1 (root combines) will involve 2 sibling nodes (and they are their only siblings) that have fallen to 5 data values each and the new delete has caused one of the nodes to fall to 4 values. 

Here is a link to appropriate node definitions to accommodate generic (base class) nodes and root nodes versus non-root nodes in your B* Trees:  Please note!  I have removed the node.cpp file from this directory  since it was an empty file and simply not needed!

Here is a link to some non-recursive code that generates B tree indexes:  (Note - this code actually works by creating the nodes as chunks of data out on disk in a datafile.  In this way it is more like a real B tree.  However, you are not creating nodes in a datafile for this assignment.  Learn what you can from this code, use it as a tool, although I will not go over it and how it works in detail.)

                        Oracle Education and Information on Certification and the Oracle Masters Program

News for 151 students:

To find the HW assignment from my home page: Look at the bottom of this page for the CSCI 151 Live Fall 1999 class and would find under the Course Reading Schedule- http://www.ecst.csuchico.edu/~melody/courses/csci151_live/Dynamic_hash_notes.htm

This last link is where the notes and assignment are -

You are to do extendible hashing problem that is discussed in the notes with
the values "A" through "G" listed there.  You are to look at my class notes on
extendible hashing and do the inserts into an empty extendible hash
structure that are listed there.  Do not use any mod function for this part of the assignment.  Hint: You will not need overflow buckets for this part of the assignment, as the hash values are all distinct.

As a second, and separate, part of the assignment, you are to insert into an
empty extendible hash structure a 5 values whose bit strings are all zeros.  You are to use a mod 32 hash function for this part of the assignment.  I.e., the hash values are 5 zeros, and they are all the same.  Hint: you will need overflow buckets for this part of the assignment.