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 閱讀(82) 評論(0)  編輯  收藏

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


          網站導航:
           
          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 梁河县| 修文县| 喀什市| 普兰县| 阿克陶县| 平陆县| 漳浦县| 紫金县| 涿州市| 蕲春县| 永吉县| 鄂托克旗| 抚顺市| 奈曼旗| 榆树市| 建平县| 浦县| 峨眉山市| 渝中区| 茶陵县| 马鞍山市| 滦南县| 达拉特旗| 荆州市| 五台县| 正安县| 巴马| 和田县| 安吉县| 环江| 三门峡市| 视频| 淮安市| 株洲县| 大关县| 板桥市| 阿荣旗| 通州市| 涟水县| 天门市| 金堂县|