_btree_btree

1
3/12/2014 www.csee.umbc.edu/~woodcock/cmsc341/btree/Btree.java http://www.csee.umbc.edu/~woodcock/cmsc341/btree/Btree.java 1/1 public class Btree { private int[] keys; private Btree[] subs; private int order; public Btree (int n) { keys = new int[n‐1]; subs = new Btree[n]; order = n; } private boolean leaf () { for (int i=0;i<order;i++) if (subs[i] != null) {return false;}; return true; } private boolean full () { for (int i=0;i<order;i++) if (subs[i] == null) {return false;}; return true; } }

Upload: jaz

Post on 25-Sep-2015

8 views

Category:

Documents


1 download

DESCRIPTION

Arbol b

TRANSCRIPT

  • 3/12/2014 www.csee.umbc.edu/~woodcock/cmsc341/btree/Btree.java

    http://www.csee.umbc.edu/~woodcock/cmsc341/btree/Btree.java 1/1

    publicclassBtree{

    privateint[]keys;privateBtree[]subs;privateintorder;

    publicBtree(intn){keys=newint[n1];subs=newBtree[n];order=n;}

    privatebooleanleaf(){for(inti=0;i