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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bplustreelong.cs

?? R樹與B樹的混合樹
?? CS
?? 第 1 頁 / 共 5 頁
字號:
					this.owner.deallocateBuffer(this.myBufferNumber);
				} 
				else 
				{
					// free on commit
					//this.owner.FreeBuffersOnCommit.Add(this.myBufferNumber);
					this.owner.FreeBuffersOnCommit[this.myBufferNumber] = this.myBufferNumber;
				}
			}
			this.myBufferNumber = BplusTreeLong.NULLBUFFERNUMBER; // don't do it twice...
		}
		public void SerializationCheck() 
		{ 
			BplusNode A = new BplusNode(this.owner, null, -1, false);
			for (int i=0; i<this.Size; i++) 
			{
				long j = i*((long)0xf0f0f0f0f0f0f01);
				A.ChildBufferNumbers[i] = j;
				A.ChildKeys[i] = "k"+i;
			}
			A.ChildBufferNumbers[this.Size] = 7;
			A.TestRebuffer();
			A.isLeaf = true;
			for (int i=0; i<this.Size; i++) 
			{
				long j = -i*((long)0x3e3e3e3e3e3e666);
				A.ChildBufferNumbers[i] = j;
				A.ChildKeys[i] = "key"+i;
			}
			A.ChildBufferNumbers[this.Size] = -9097;
			A.TestRebuffer();
		}
		void TestRebuffer() 
		{
			bool IL = this.isLeaf;
			long[] Ns = this.ChildBufferNumbers;
			string[] Ks = this.ChildKeys;
			byte[] buffer = new byte[this.owner.buffersize];
			this.Dump(buffer);
			this.Clear();
			this.Load(buffer);
			for (int i=0; i<this.Size; i++) 
			{
				if (this.ChildBufferNumbers[i]!=Ns[i]) 
				{
					throw new BplusTreeException("didn't get back buffernumber "+i+" got "+this.ChildBufferNumbers[i]+" not "+Ns[i]);
				}
				if (!this.ChildKeys[i].Equals(Ks[i])) 
				{
					throw new BplusTreeException("didn't get back key "+i+" got "+this.ChildKeys[i]+" not "+Ks[i]);
				}
			}
			if (this.ChildBufferNumbers[this.Size]!=Ns[this.Size]) 
			{
				throw new BplusTreeException("didn't get back buffernumber "+this.Size+" got "+this.ChildBufferNumbers[this.Size]+" not "+Ns[this.Size]);
			}
			if (this.isLeaf!=IL) 
			{
				throw new BplusTreeException("isLeaf should be "+IL+" got "+this.isLeaf);
			}
		}
		public string SanityCheck(Hashtable visited) 
		{
			string result = null;
			if (visited==null) 
			{
				visited = new Hashtable();
			}
			if (visited.ContainsKey(this)) 
			{
				throw new BplusTreeException("node visited twice "+this.myBufferNumber);
			}
			visited[this] = this.myBufferNumber;
			if (this.myBufferNumber!=BplusTreeLong.NULLBUFFERNUMBER) 
			{
				if (visited.ContainsKey(this.myBufferNumber))
				{
					throw new BplusTreeException("buffer number seen twice "+this.myBufferNumber);
				}
				visited[this.myBufferNumber] = this;
			}
			if (this.parent!=null) 
			{
				if (this.parent.isLeaf) 
				{
					throw new BplusTreeException("parent is leaf");
				}
				this.parent.MaterializeNodeAtIndex(this.indexInParent);
				if (this.parent.MaterializedChildNodes[this.indexInParent]!=this) 
				{
					throw new BplusTreeException("incorrect index in parent");
				}
				// since not at root there should be at least size/2 keys
				int limit = this.Size/2;
				if (this.isLeaf) 
				{
					limit--;
				}
				for (int i=0; i<limit; i++) 
				{
					if (this.ChildKeys[i]==null) 
					{
						throw new BplusTreeException("null child in first half");
					}
				}
			}
			result = this.ChildKeys[0]; // for leaf
			if (!this.isLeaf) 
			{
				this.MaterializeNodeAtIndex(0);
				result = this.MaterializedChildNodes[0].SanityCheck(visited);
				for (int i=0; i<this.Size; i++) 
				{
					if (this.ChildKeys[i]==null) 
					{
						break;
					}
					this.MaterializeNodeAtIndex(i+1);
					string least = this.MaterializedChildNodes[i+1].SanityCheck(visited);
					if (least==null) 
					{
						throw new BplusTreeException("null least in child doesn't match node entry "+this.ChildKeys[i]);
					}
					if (!least.Equals(this.ChildKeys[i])) 
					{
						throw new BplusTreeException("least in child "+least+" doesn't match node entry "+this.ChildKeys[i]);
					}
				}
			}
			// look for duplicate keys
			string lastkey = this.ChildKeys[0];
			for (int i=1; i<this.Size; i++) 
			{
				if (this.ChildKeys[i]==null) 
				{
					break;
				}
				if (lastkey.Equals(this.ChildKeys[i]) ) 
				{
					throw new BplusTreeException("duplicate key in node "+lastkey);
				}
				lastkey = this.ChildKeys[i];
			}
			return result;
		}
		void Destroy() 
		{
			// make sure the structure is useless, it should no longer be used.
			this.owner = null;
			this.parent = null;
			this.Size = -100;
			this.ChildBufferNumbers = null;
			this.ChildKeys = null;
			this.MaterializedChildNodes = null;
			this.myBufferNumber = BplusTreeLong.NULLBUFFERNUMBER;
			this.indexInParent = -100;
			this.Dirty = false;
		}
		public int SizeInUse() 
		{
			int result = 0;
			for (int i=0; i<this.Size; i++) 
			{
				if (this.ChildKeys[i]==null) 
				{
					break;
				}
				result++;
			}
			return result;
		}
		public static BplusNode BinaryRoot(BplusNode LeftNode, string key, BplusNode RightNode, BplusTreeLong owner) 
		{
			BplusNode newRoot = new BplusNode(owner, null, -1, false);
			//newRoot.Clear(); // redundant
			newRoot.ChildKeys[0] = key;
			LeftNode.Reparent(newRoot, 0);
			RightNode.Reparent(newRoot, 1);
			// new root is stored elsewhere
			return newRoot;
		}
		void Reparent(BplusNode newParent, int ParentIndex) 
		{
			// keys and existing parent structure must be updated elsewhere.
			this.parent = newParent;
			this.indexInParent = ParentIndex;
			newParent.ChildBufferNumbers[ParentIndex] = this.myBufferNumber;
			newParent.MaterializedChildNodes[ParentIndex] = this;
			// parent is no longer terminal
			this.owner.ForgetTerminalNode(parent);
		}
		void Clear() 
		{
			this.ChildBufferNumbers = new long[this.Size+1];
			this.ChildKeys = new string[this.Size];
			this.MaterializedChildNodes = new BplusNode[this.Size+1];
			for (int i=0; i<this.Size; i++) 
			{
				this.ChildBufferNumbers[i] = BplusTreeLong.NULLBUFFERNUMBER;
				this.MaterializedChildNodes[i] = null;
				this.ChildKeys[i] = null;
			}
			this.ChildBufferNumbers[this.Size] = BplusTreeLong.NULLBUFFERNUMBER;
			this.MaterializedChildNodes[this.Size] = null;
			// this is now a terminal node
			this.owner.RecordTerminalNode(this);
		}
		/// <summary>
		/// Find first index in self associated with a key same or greater than CompareKey
		/// </summary>
		/// <param name="CompareKey">CompareKey</param>
		/// <param name="LookPastOnly">if true and this is a leaf then look for a greater value</param>
		/// <returns>lowest index of same or greater key or this.Size if no greater key.</returns>
		int FindAtOrNextPosition(string CompareKey, bool LookPastOnly) 
		{
			int insertposition = 0;
			//System.Globalization.CultureInfo culture = this.owner.cultureContext;
			//System.Globalization.CompareInfo cmp = culture.CompareInfo;
			if (this.isLeaf && !LookPastOnly) 
			{
				// look for exact match or greater or null
				while (insertposition<this.Size && this.ChildKeys[insertposition]!=null &&
					//cmp.Compare(this.ChildKeys[insertposition], CompareKey)<0) 
					this.owner.Compare(this.ChildKeys[insertposition], CompareKey)<0)
				{
					insertposition++;
				}
			} 
			else 
			{
				// look for greater or null only
				while (insertposition<this.Size && this.ChildKeys[insertposition]!=null &&
					this.owner.Compare(this.ChildKeys[insertposition], CompareKey)<=0) 
				{
					insertposition++;
				}
			}
			return insertposition;
		}
		/// <summary>
		/// Find the first key below atIndex, or if no such node traverse to the next key to the right.
		/// If no such key exists, return nulls.
		/// </summary>
		/// <param name="atIndex">where to look in this node</param>
		/// <param name="FoundInLeaf">leaf where found</param>
		/// <param name="KeyFound">key value found</param>
		void TraverseToFollowingKey(int atIndex, out BplusNode FoundInLeaf, out string KeyFound) 
		{
			FoundInLeaf = null;
			KeyFound = null;
			bool LookInParent = false;
			if (this.isLeaf) 
			{
				LookInParent = (atIndex>=this.Size) || (this.ChildKeys[atIndex]==null);
			} 
			else 
			{
				LookInParent = (atIndex>this.Size) ||
					(atIndex>0 && this.ChildKeys[atIndex-1]==null);
			}
			if (LookInParent) 
			{
				// if it's anywhere it's in the next child of parent
				if (this.parent!=null && this.indexInParent>=0) 
				{
					this.parent.TraverseToFollowingKey(this.indexInParent+1, out FoundInLeaf, out KeyFound);
					return;
				} 
				else 
				{
					return; // no such following key
				}
			}
			if (this.isLeaf) 
			{
				// leaf, we found it.
				FoundInLeaf = this;
				KeyFound = this.ChildKeys[atIndex];
				return;
			} 
			else 
			{
				// nonleaf, look in child (if there is one)
				if (atIndex==0 || this.ChildKeys[atIndex-1]!=null) 
				{
					BplusNode thechild = this.MaterializeNodeAtIndex(atIndex);
					thechild.TraverseToFollowingKey(0, out FoundInLeaf, out KeyFound);
				}
			}
		}
		public bool FindMatch(string CompareKey, out long ValueFound) 
		{
			ValueFound = 0; // dummy value on failure
			BplusNode leaf;
			int position = this.FindAtOrNextPositionInLeaf(CompareKey, out leaf, false);
			if (position<leaf.Size) 
			{
				string key = leaf.ChildKeys[position];
				if ((key!=null) && this.owner.Compare(key, CompareKey)==0) //(key.Equals(CompareKey)
				{
					ValueFound = leaf.ChildBufferNumbers[position];
					return true;
				}
			}
			return false;
		}
		public string FindNextKey(string CompareKey) 
		{
			string result = null;
			BplusNode leaf;
			int position = this.FindAtOrNextPositionInLeaf(CompareKey, out leaf, true);
			if (position>=leaf.Size || leaf.ChildKeys[position]==null) 
			{
				// try to traverse to the right.
				BplusNode newleaf;
				leaf.TraverseToFollowingKey(leaf.Size, out newleaf, out result);
			} 
			else 
			{
				result = leaf.ChildKeys[position];
			}
			return result;
		}
		/// <summary>
		/// Find near-index of comparekey in leaf under this node. 
		/// </summary>
		/// <param name="CompareKey">the key to look for</param>
		/// <param name="inLeaf">the leaf where found</param>
		/// <param name="LookPastOnly">If true then only look for a greater value, not an exact match.</param>
		/// <returns>index of match in leaf</returns>
		int FindAtOrNextPositionInLeaf(string CompareKey, out BplusNode inLeaf, bool LookPastOnly) 
		{
			int myposition = this.FindAtOrNextPosition(CompareKey, LookPastOnly);
			if (this.isLeaf) 
			{
				inLeaf = this;
				return myposition;
			}
			long childBufferNumber = this.ChildBufferNumbers[myposition];
			if (childBufferNumber==BplusTreeLong.NULLBUFFERNUMBER) 
			{
				throw new BplusTreeException("can't search null subtree");
			}
			BplusNode child = this.MaterializeNodeAtIndex(myposition);
			return child.FindAtOrNextPositionInLeaf(CompareKey, out inLeaf, LookPastOnly);
		}
		BplusNode MaterializeNodeAtIndex(int myposition) 
		{
			if (this.isLeaf) 
			{
				throw new BplusTreeException("cannot materialize child for leaf");
			}
			long childBufferNumber = this.ChildBufferNumbers[myposition];
			if (childBufferNumber==BplusTreeLong.NULLBUFFERNUMBER) 
			{
				throw new BplusTreeException("can't search null subtree at position "+myposition+" in "+this.myBufferNumber);
			}
			// is it already materialized?
			BplusNode result = this.MaterializedChildNodes[myposition];
			if (result!=null) 
			{
				return result;
			}
			// otherwise read it in...
			result = new BplusNode(this.owner, this, myposition, true); // dummy isLeaf value
			result.LoadFromBuffer(childBufferNumber);
			this.MaterializedChildNodes[myposition] = result;
			// no longer terminal
			this.owner.ForgetTerminalNode(this);
			return result;
		}
		public void LoadFromBuffer(long bufferNumber) 
		{
			// freelist bookkeeping done elsewhere
			string parentinfo = "no parent"; // debug
			if (this.parent!=null) 
			{
				parentinfo = "parent="+parent.myBufferNumber; // debug
			}
			//System.Diagnostics.Debug.WriteLine("\r\n<br> loading "+this.indexInParent+" from "+bufferNumber+" for "+parentinfo);
			byte[] rawdata = new byte[this.owner.buffersize];
			this.owner.buffers.getBuffer(bufferNumber, rawdata, 0, rawdata.Length);
			this.Load(rawdata);
			this.Dirty = false;
			this.myBufferNumber = bufferNumber;
			// it's terminal until a child is materialized
			this.owner.RecordTerminalNode(this);
		}
		public long DumpToFreshBuffer() 
		{
			long oldbuffernumber = this.myBufferNumber;
			long freshBufferNumber = this.owner.allocateBuffer();
			//System.Diagnostics.Debug.WriteLine("\r\n<br> dumping "+this.indexInParent+" from "+oldbuffernumber+" to "+freshBufferNumber);
			this.DumpToBuffer(freshBufferNumber);
			if (oldbuffernumber!=BplusTreeLong.NULLBUFFERNUMBER) 
			{
				//this.owner.FreeBuffersOnCommit.Add(oldbuffernumber);
				if (this.owner.FreeBuffersOnAbort.ContainsKey(oldbuffernumber)) 
				{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频一区二区三区在线观看| 国产网站一区二区| 欧美精品久久99久久在免费线 | 成人午夜在线免费| 在线观看免费一区| 久久综合久色欧美综合狠狠| 一区二区三区在线观看国产| 免费人成精品欧美精品| 91在线精品秘密一区二区| 337p粉嫩大胆噜噜噜噜噜91av | 国产三级欧美三级| 日韩高清一级片| 91在线精品一区二区三区| 国产色爱av资源综合区| 蜜乳av一区二区三区| 91福利视频在线| 国产精品国产精品国产专区不片| 美日韩黄色大片| 欧美另类z0zxhd电影| 亚洲柠檬福利资源导航| www.久久精品| 国产欧美日韩中文久久| 日本中文字幕一区二区有限公司| www.性欧美| 亚洲天堂精品在线观看| 丁香婷婷综合激情五月色| 精品国产污污免费网站入口| 蜜臀av一区二区在线免费观看| 欧美午夜宅男影院| 久久午夜免费电影| 麻豆一区二区在线| 日韩欧美国产麻豆| 免费成人在线网站| 欧美老女人在线| 日韩av不卡一区二区| 欧美三级日韩三级| 日韩不卡在线观看日韩不卡视频| 在线不卡的av| 精品在线观看视频| 久久久久国产精品人| 粉嫩高潮美女一区二区三区| 久久免费电影网| 成人性生交大片免费看视频在线 | 天天综合色天天综合色h| 在线亚洲精品福利网址导航| 日韩毛片高清在线播放| 91国内精品野花午夜精品| 一区二区三区免费看视频| 在线视频观看一区| 亚洲精品国产a| 国产成人免费在线观看| 久久久99精品免费观看| 91性感美女视频| 亚洲午夜在线观看视频在线| 6080日韩午夜伦伦午夜伦| 免费看精品久久片| 欧美国产乱子伦| 在线观看不卡一区| 日韩激情视频在线观看| 日韩欧美中文字幕精品| 国产专区综合网| 国产精品三级av| 欧美区一区二区三区| 国产伦精品一区二区三区免费| 国产精品乱码妇女bbbb| 国产一区不卡在线| 精品一区中文字幕| 91精品久久久久久久91蜜桃| 日韩一区精品字幕| a亚洲天堂av| 午夜国产精品一区| 久久精品亚洲麻豆av一区二区 | 欧美一级理论片| 国产成人高清视频| 午夜不卡在线视频| 国产精品视频第一区| 欧美伦理电影网| 成人av网站在线观看免费| 日韩**一区毛片| 中文字幕一区二区三区乱码在线| 欧美人妖巨大在线| 国产精品18久久久久久久久| 亚洲高清视频在线| 国产精品高潮呻吟| 日韩精品一区二区三区中文精品| 91成人网在线| 韩国精品在线观看| 日韩不卡一二三区| 亚洲精品中文字幕乱码三区| 久久亚洲一区二区三区明星换脸 | 夜色激情一区二区| 久久久亚洲综合| 精品视频一区二区三区免费| 国产91精品露脸国语对白| 毛片一区二区三区| 五月激情六月综合| 中文字幕亚洲电影| 国产嫩草影院久久久久| 欧美一区二区成人| 9191成人精品久久| 欧美体内she精高潮| 99re这里都是精品| 日本二三区不卡| av在线播放一区二区三区| 免费在线观看精品| 一区二区三区在线视频观看58| 麻豆精品蜜桃视频网站| 天天av天天翘天天综合网色鬼国产 | 午夜不卡av免费| 国产精品精品国产色婷婷| 欧美国产精品一区二区| 欧美疯狂性受xxxxx喷水图片| 欧美一级精品在线| 欧美肥胖老妇做爰| 欧美狂野另类xxxxoooo| 日本高清无吗v一区| 色婷婷国产精品久久包臀| kk眼镜猥琐国模调教系列一区二区| 国产电影精品久久禁18| 国产精品资源网| 国产精品一区二区在线观看网站| 精久久久久久久久久久| 国产一区二区三区免费观看| 精品一区二区av| 国产高清久久久| 北条麻妃一区二区三区| 91麻豆免费视频| 欧美性受xxxx| 日韩无一区二区| 精品久久久久久久久久久久包黑料| 欧美一级电影网站| 久久日一线二线三线suv| 久久久亚洲午夜电影| 国产欧美一区二区三区在线老狼| 久久久久久9999| 国产精品久久综合| 亚洲欧美激情小说另类| 一区二区三区中文免费| 日本亚洲免费观看| 国产精品18久久久久久久网站| 99久久精品国产网站| 欧美日韩国产一二三| xvideos.蜜桃一区二区| 亚洲欧美一区二区视频| 天堂蜜桃一区二区三区| 国产麻豆精品在线观看| 91浏览器在线视频| 日韩精品一区二区三区在线观看 | 亚洲高清免费在线| 蜜臀av一区二区| 99热这里都是精品| 91精品国产乱码久久蜜臀| 国产日韩欧美一区二区三区综合| 亚洲国产精品ⅴa在线观看| 一区二区三区在线高清| 美国av一区二区| 99re热视频这里只精品| 日韩一区二区精品葵司在线| 中文字幕在线观看不卡视频| 日本 国产 欧美色综合| 粉嫩一区二区三区性色av| 欧美卡1卡2卡| 亚洲欧洲综合另类| 国内久久婷婷综合| 欧美日韩黄色一区二区| 国产精品对白交换视频| 激情综合亚洲精品| 欧美体内she精高潮| 中文字幕在线不卡| 国产一区二区日韩精品| 欧美群妇大交群的观看方式| 亚洲色图视频网| 国产精品香蕉一区二区三区| 欧美日本在线播放| 亚洲精品久久7777| 成人免费毛片a| 久久久久综合网| 老汉av免费一区二区三区| 欧美三级蜜桃2在线观看| 亚洲欧洲一区二区在线播放| 国产一区二区三区高清播放| 日韩欧美在线网站| 天天综合网天天综合色| 欧美性xxxxxxxx| 一区二区三区91| 色激情天天射综合网| 亚洲国产高清不卡| 国产成人啪免费观看软件 | 欧美视频一区二| 亚洲精品美腿丝袜| 91视频精品在这里| 成人欧美一区二区三区白人| 成人美女视频在线看| 日韩欧美一卡二卡| 日韩欧美国产一区二区在线播放| 欧美蜜桃一区二区三区| 亚洲精品国产无天堂网2021 | 在线观看免费一区| 亚洲女同一区二区| 欧美亚洲动漫制服丝袜|