亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? zbtree.h

?? 實(shí)現(xiàn)一個(gè)精簡型單用戶SQL引擎(DBMS)MiniSQL
?? H
字號(hào):
/****************************************************************** 

** Filename : ZBtree.h

** Copyright (c) 2001-2002 Computer Science & Technology Zhejiang University 

** Editor   : zhousen(周森)

** Date     : 2001-12-18 To 2002-01-05

** Version  : 1.00

******************************************************************/

#ifndef ZBTREE_H
#define ZBTREE_H

#include "Glob_Var.h"
#include "buffer.h"
#include "Intepretor.h"

//-------------------------------ZBTree_Index---------------------------------
// the head of index file
// it contains the basic informatior used for b+ tree
typedef struct TIndex_Head
{
  _F_FileAddr FirstEmptyBlock;  // the address of the first empty block
  _F_FileAddr LastEmptyBlock;   // the address of the last empty block
  _F_FileAddr FirstNewBlock;    // the address of the first new block 
  _F_FileAddr root;             // the address of the root
  _F_FileAddr start;            // the address of the most left node
  int         KeyAttrNum;	    // the number of fields(attributes) in primary key
  int         KeySize;         	// sizeof(Key_Attr) * KeyAttrNum
  int         MaxItemNum;       // the max number of keys in a node
}Index_Head;

// this class defines some operation on the head of the index file
// such as write and read the head into memery 
class ZBTree_Index
{
  public:
    ZBTree_Index();      
     ~ZBTree_Index();
    void    Create_Head(char* KeyStr);   // produce the information in the IdxHead 
    void    WriteHeadToFile();           // write the information to the head of the file 
    void    ReadHeadFromFile();          // read  the information form the head of the file
    void    SetKeyInfo(char* Key_Info);  // calculate the Keysize and KeyAttrNum
    int     GetKeySize();                // get the size of a key
    int     GetKeyAttrNum();             // get the key attribute number in a key 
    int     GetMaxItemNum();             // get the max number of items in a key
    char*   GetKeyInfo();                // get the key information

    _F_FileAddr GetRoot();               // get the File Point of the root
    _F_FileAddr GetStartNode();          // get the File Point of the leftmost node
    _F_FileAddr GetFirstNewBlock();      // get the File Point of the fisrt new block
    _F_FileAddr GetFirstEmptyBlock();    // get the File Point of the fisrt empty block
    _F_FileAddr GetLastEmptyBlock();     // get the File Point of the last empty block
    
    Index_Head IdxHead;  // the head of the index file for B+ tree 
      
  private:     
    char*  KeyInfo;      // a string record the information of the key
}; 
//-------------------------------ZBTree_Index----------------------------------

//*****************************************************************************

//-------------------------------ZBTree_Node-----------------------------------

// the struct of node
// Next_Empty_Block|NodeType | ItemOnNode | p[0],k[0],p[1],k[1],...,p[MaxItem]
class ZBTree_Node
{
  public:
    ZBTree_Node();
    ~ZBTree_Node();
    void Reset();                           // set p[i] = NULL,ItemOnNode = 0
    void ReadNodeFromFile(_F_FileAddr ptr); // read the content of the node from the file  
    void WriteNodeToFile( _F_FileAddr ptr); // write the content of the node to the file
    void InsertKeyInLeaf(_F_FileAddr pRec,pKey_Attr pPrimKey);    // insert a key in leaf node
    void DeleteKeyInLeaf(pKey_Attr pPrimKey);                     // delete a key in leaf node
    void InsertKeyNotInLeaf(pKey_Attr pPrimKey,_F_FileAddr pRec); // insert a key in non-leaf node
    void DeleteKeyNotInLeaf(pKey_Attr pPrimKey);                  // delete a key in non-leaf node
    void DeleteKey(pKey_Attr Key);               // delete the space occupied by key
    void DeleteKeyV_();                          // delete the fisrt key in the non-leaf node 
    void CopyKey(pKey_Attr Key1,pKey_Attr Key2); //copy key1 from key2
    bool IsNotEnoughPt();                        // too small points
    int  Compare(pKey_Attr Key1,pKey_Attr Key2); // 1--'>'   0--'='    -1--'<'
    pKey_Attr CreateKey(pKey_Attr Key1);         // create a new key equal to key1
  
  public:
    _F_FileAddr *p;                // p[MaxItem+1]; the array of points who point to the son nodes
    _F_FileAddr Next_Empty_Block;  // point to the next empty block
    pKey_Attr *k;                  // k[MaxItem];   the point_array of Keys
    bool    IsLeaf;                // 1--Leaf 0--Not leaf
    int     ItemOnNode;            // the number of the valid Keys
    int     MaxItem;               // the max number of key in a node
    int     KeySize;               // the size of a key
    char*   KeyInfo;               // the information of attributes in a key
};


//-------------------------------ZBTree_Node-----------------------------------

//*****************************************************************************

//----------------------------------ZBTree--------------------------------------
// the biggest value of depth in the b+tree,which is impossible to reach 
const int DEPTH = 20;  

// this class defines all operation on b+ tree
class ZBTree
{
  public:
    ZBTree();
    ~ZBTree();
    void Create(char* KeyStr);              // create the index file and initialize it
    void GrantRoot(_F_FileAddr ptr);        // grant root to an existed node 
    void DeleteNodeInFile(_F_FileAddr ptr); // delete a node in the index file
    // search the primary key,and place its address into pKeyLoca 
    bool Search(pKey_Attr pPrimKey,pKey_Location pKeyLoca);
    void Insert(pKey_Attr pPrimKey,_F_FileAddr pRec);  
    void Delete(pKey_Attr pPrimKey,_F_FileAddr& pRec);
    void Delete_Entry(_F_FileAddr L,pKey_Attr pPrimKey,_F_FileAddr pRec); 
    void Insert_Entry(_F_FileAddr L,pKey_Attr pPrimKey,_F_FileAddr pRec);

    // set pL_ and ppPrimkey and pIsLeftOfL_
    void SetL_(_F_FileAddr L,_F_FileAddr* pL_,pKey_Attr* ppPrimKey_,bool* pIsLLeftOfL_);
    // merge the two node pNodeL and pNodeL_
    void Merge(ZBTree_Node* pNodeL,ZBTree_Node* pNodeL_,pKey_Attr pPrimKey_,bool IsLLeftOfL_);
    // swap the L and L_ the parent node of L
    void SwapVariables(_F_FileAddr L,_F_FileAddr L_);
    // replace the key equal to Key_ with Key in the node pointed by ptr  
    void ReplaceKey(_F_FileAddr ptr,pKey_Attr Key_,pKey_Attr Key);
    // redistribute the tree when it can't emerge the tree
    void ReDistribute(ZBTree_Node* pNodeL,ZBTree_Node* pNodeL_,pKey_Attr pPrimKey_,bool IsLLeftOfL_,_F_FileAddr L);
    // create a new root node ----  po | pPrimKey | p1
    void CreateNewRoot(_F_FileAddr p0,pKey_Attr pPrimKey,_F_FileAddr p1);
        
    bool CanMerge(ZBTree_Node* pNode,ZBTree_Node* pNode_);  // whethe the two node can merge
    bool IsRoot(_F_FileAddr ptr); // the ptr : 0 -- root address 1 -- non-root address
    bool IsEmpty();               // the tree: 0 -- empty   1 -- non-empty 
    
    _F_FileAddr Parent(_F_FileAddr ptr);              // get the parent node address
    _F_FileAddr GetCurRecAddr(Key_Location KeyLoca);  // get the record address
    _F_FileAddr CreateNodeInFile();                   // get an empty node in the index file   

    Key_Location MoveToNextKey(Key_Location KeyLoca); // get the next key address
    Key_Location GetStart();  // get the leftmost key address
    Key_Location GetEnd();    // get the rightmost key address 
    
  private:
    void SetPath();                 // set path to *.idx
    _F_FileAddr SearchPath[DEPTH];  // the path of a search operation
    
};

#endif   //ZBTREE_H

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩三级av在线播放| 精品一区二区在线看| 欧美影视一区在线| 五月天久久比比资源色| 欧美日韩一区小说| 麻豆成人久久精品二区三区红 | 天天色天天操综合| 欧美一三区三区四区免费在线看| 日韩精品电影一区亚洲| 欧美一区二区三区视频在线| 国产精品一区二区在线观看网站| 精品国产三级a在线观看| 国产福利一区二区| 亚洲二区在线视频| 国产性天天综合网| 欧美色国产精品| 国产精品小仙女| 一区二区三区丝袜| 久久久.com| 欧美日本在线看| 95精品视频在线| 精品在线你懂的| 亚洲综合成人在线视频| 国产精品午夜电影| 精品少妇一区二区三区在线播放| 91首页免费视频| 国内精品在线播放| 亚洲福中文字幕伊人影院| 国产日韩欧美在线一区| 欧美一级高清片| 欧美亚洲禁片免费| 不卡的av在线| 国产毛片一区二区| 精品一区二区免费| 视频一区视频二区在线观看| 国产精品免费网站在线观看| 久久色.com| 亚洲精品一区在线观看| 日韩免费福利电影在线观看| 91 com成人网| 欧美日韩国产精选| 91精品国产aⅴ一区二区| 91麻豆精品91久久久久同性| 日韩三级高清在线| 久久美女高清视频| 久久九九全国免费| 国产精品久久久久影院色老大| 国产亚洲一二三区| 日韩美女视频19| 亚洲一区二区精品3399| 日韩成人av影视| 国产一区二区三区久久悠悠色av| 国产露脸91国语对白| 成人免费视频国产在线观看| 不卡影院免费观看| 欧美日韩免费高清一区色橹橹| 日韩视频123| 色婷婷国产精品久久包臀| 亚洲va欧美va人人爽午夜| 久久综合色天天久久综合图片| 国产精品久久久久久久久搜平片| 久久精品国产在热久久| 欧美在线免费观看视频| 一区二区三区在线高清| 国产99一区视频免费| 欧美一区二区三区不卡| 国产精品欧美精品| 免费观看成人鲁鲁鲁鲁鲁视频| 国产寡妇亲子伦一区二区| 色综合视频在线观看| 精品久久人人做人人爰| 樱花草国产18久久久久| 国产成人小视频| 日韩一区二区三区在线观看| 中文字幕一区三区| 国产盗摄一区二区| 欧美日韩国产123区| 最新久久zyz资源站| 久久超碰97人人做人人爱| 欧美日韩一区中文字幕| 亚洲日本中文字幕区| 丁香天五香天堂综合| 日韩欧美国产不卡| 亚洲国产视频a| 一本色道久久综合亚洲精品按摩| 337p粉嫩大胆噜噜噜噜噜91av | 成人国产精品免费网站| 91精品国产91久久久久久一区二区| 亚洲一区在线视频观看| 欧美日韩综合色| 日韩精品高清不卡| 日韩一区二区三区电影在线观看| 亚洲国产成人91porn| 欧美日韩在线观看一区二区 | 久久精品国产99| 日本一区二区三区四区| 成人美女在线视频| 一区在线观看免费| 欧美日韩国产影片| 香蕉成人啪国产精品视频综合网| 717成人午夜免费福利电影| 蜜臀久久久久久久| 久久夜色精品国产噜噜av| 老司机精品视频一区二区三区| 欧美刺激脚交jootjob| 国产精品12区| 亚洲精品国产精品乱码不99| 91福利视频网站| 同产精品九九九| 久久精品在线观看| 欧美日韩视频在线观看一区二区三区| 日韩av电影天堂| 国产欧美日韩精品a在线观看| 成人ar影院免费观看视频| 免费在线一区观看| 亚洲成av人片在线| 亚洲激情在线播放| 综合亚洲深深色噜噜狠狠网站| 26uuu另类欧美亚洲曰本| 欧美日韩国产高清一区| 91麻豆自制传媒国产之光| 国产伦理精品不卡| 久久电影国产免费久久电影| 日韩精品久久久久久| 亚洲美女屁股眼交| 大桥未久av一区二区三区中文| 亚洲午夜激情网站| 一区二区三区中文在线| 久久免费午夜影院| 91精品国产色综合久久久蜜香臀| 99re这里只有精品6| 成人av网站免费观看| 在线亚洲精品福利网址导航| 成人在线视频一区二区| 成人小视频在线观看| 国产精品亚洲成人| 国产主播一区二区| 国产精品资源站在线| 国产毛片精品国产一区二区三区| 午夜私人影院久久久久| 亚洲国产成人av好男人在线观看| 亚洲婷婷综合色高清在线| 亚洲欧美怡红院| 国产精品国产三级国产普通话三级| 久久久久久电影| 国产亚洲一二三区| 中文字幕制服丝袜一区二区三区| 久久精品综合网| 亚洲素人一区二区| 亚洲高清免费视频| 久久爱www久久做| www..com久久爱| 欧美视频一二三区| 日韩一区二区三区av| 久久人人爽人人爽| 亚洲欧美日韩人成在线播放| 亚洲福利视频一区二区| 人人爽香蕉精品| 成人99免费视频| 欧美高清视频不卡网| 久久网这里都是精品| 亚洲在线视频网站| 国产乱码精品一区二区三区av| 一本大道av一区二区在线播放| 欧美一区二区三区四区视频| 国产欧美日韩三区| 日韩精品高清不卡| 91免费看片在线观看| 欧美电影免费观看高清完整版| 亚洲欧美一区二区久久| 精品亚洲国产成人av制服丝袜| 色一情一乱一乱一91av| 久久精品视频免费| 日韩电影一二三区| 色88888久久久久久影院野外| 久久精品在线观看| 久久99精品久久久久| 91麻豆精品国产自产在线观看一区| 亚洲欧洲成人av每日更新| 极品少妇一区二区| 日韩欧美一级二级三级| 亚洲电影你懂得| 色成人在线视频| 亚洲精品乱码久久久久久| 成人一区二区三区中文字幕| 精品欧美一区二区久久| 午夜精品福利一区二区蜜股av| 91视频91自| 亚洲色图欧洲色图婷婷| 色香蕉久久蜜桃| 中文字幕一区二区在线观看 | 亚洲柠檬福利资源导航| 韩国欧美一区二区| 欧美成人一区二区三区在线观看| 看国产成人h片视频| 欧美精品一区二区在线观看| 麻豆精品视频在线| 日韩一级免费观看| 麻豆一区二区三| 国产欧美日韩麻豆91|