Next: On B+ Trees and
Up: Part 3: B+ and
Previous: Part 3: B+ and
Sorry for not specifying this sooner. I did mention that the B+ tree would have to implement
SortedMap and that I would use it myself in the same way I did your skiplists. Unfortunately
a few details were left out.
- : Names. Your class should be called BPTree and be contained in cmsc420/BPTree.java
- Constructors: while copy constructors are good too, I only really care about
4 constructors:
- BPTree() //defaults to order 3, assumes added elements implement comparable
- BPTree(Comparator c) //defaults to order 3, uses comparator and never tries to cast an added object to a Comparable
- BPTree(int order)
- BPTree(Comparator c, int order)
While I want you to support the full interface (headset/tailset/etc excepted), be especially
careful to be sure that values()/keySet()/entrySet().iterator() work, as well as get() and
put(). I won't really be looking at much else. I guess that's it for that.
One hint if anyone really likes their class name (other than BPTree), you can just add an extra BPTree.java
file with the following contents and you'll be set:
//file cmsc420/BPTree.java
package cmsc420;
public class BPTree extends YOURNAME
{
public BPTree(){super();}
public BPTree(Comparator c){super(c);}
public BPTree(int order){super(order);}
public BPTree(Comparator c, int order){super(c,order);}
}
Next: On B+ Trees and
Up: Part 3: B+ and
Previous: Part 3: B+ and
Brian Krznarich
2003-05-11
Web Accessibility