posts - 2,  comments - 7,  trackbacks - 0
          public interface NodeType {
                  
          public static final byte LEAF = 0;
                  
          public static final byte INNER = 1;
          }

          public abstract class Node implements NodeType {
                  
          protected byte type;//node type

                  
          protected long id; //node id
                  protected int num; //number of keys
                  protected double[] keys = null;//new Key[M/N];
                  
              
          private static long lastId = 0;

              
          public static synchronized long getNextId() {
                  
          return ++lastId;
              }

              
          public static long getLastId() {
                  
          return lastId;
              }
              
              
          public long getId(){
                  
          return id;
              }
              
              
          /**
               * leaf node always with height to be 0, so LNode don't need to override it
               
          */
              
          public int getHeight(){
                  
          return 0;
              }   
          }

          public class ResultList{
              
          public ResultNode header;
              
          private int l;
              
          public ResultList(){
              header 
          = new ResultNode();
              }

              
          public ResultList(ResultNode n){
              header 
          = n;
              }
              
          public int length(){
              
          return l;
              }
              
          public void inc(){
              l
          ++;
              }
          }

          public class ResultNode{
              
          public double[] p;
              
          public double k;
              
          public ResultNode next;
              
              
          public ResultNode(){
              p 
          = null;
              k 
          = 0;
              next 
          = null;
              }

              
          public ResultNode(double k, double[] p){
              
          this(k, p, null);
              }

              
          public ResultNode(double k, double[] p, ResultNode n){
              
          this.k = k;
              
          this.p = p;
              
          this.next = n;
              }
          }

          posted on 2007-10-17 15:25 Fay 閱讀(81) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 大英县| 贵溪市| 云梦县| 福贡县| 虞城县| 突泉县| 德庆县| 石嘴山市| 团风县| 万源市| 肃宁县| 鄂托克旗| 星子县| 安阳县| 开江县| 鹤山市| 武义县| 溧阳市| 虎林市| 永寿县| 蕉岭县| 平潭县| 黄大仙区| 措美县| 义乌市| 华亭县| 林州市| 买车| 南澳县| 塔城市| 齐河县| 抚顺县| 登封市| 灵台县| 开鲁县| 苍山县| 红安县| 郸城县| 社旗县| 惠来县| 衡山县|