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)

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 桦甸市| 蒙阴县| 蕲春县| 东乡族自治县| 丰台区| 仲巴县| 泉州市| 德阳市| 连南| 通州区| 新乐市| 安平县| 浑源县| 玛纳斯县| 西安市| 北碚区| 新安县| 长岭县| 天气| 红河县| 金乡县| 吉林省| 永善县| 福鼎市| 白水县| 友谊县| 古蔺县| 明星| 乐平市| 安康市| 壶关县| 桓台县| 洛浦县| 临江市| 宁陵县| 湘潭县| 东源县| 广东省| 扎兰屯市| 莲花县| 朝阳县|