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

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

?? readme.htm

?? 一個(gè)用Basic實(shí)現(xiàn)的B-Tree算法
?? HTM
字號(hào):
<title>B-tree algorithms</title><h2>B-tree algorithms</h2><p>A B-tree is a data structure that maintains an ordered set of data and allows efficient operations to find, delete, insert, and browse the data.  In this discussion, each piece of data stored in a B-tree will be called a "key", because each key is unique and can occur in the B-tree in only one location.<p>A B-tree consists of "node" records containing the keys, and pointers that link the nodes of the B-tree together.<p>Every B-tree is of some "order n", meaning nodes contain from n to 2n keys (so nodes are always at least half full of keys), and n+1 to 2n+1 pointers, and n can be any number.<p>Keys are kept in sorted order within each node.  A corresponding list of pointers are effectively interspersed between keys to indicate where to search for a key if it isn't in the current node.<p>For example, here is a portion of a B-tree with order 2 (every node must have at least 2 keys and 3 pointers).  Nodes are delimited with [square brackets].  The keys are city names, and are kept sorted in each node:<pre>                           |                            v                   [ Chicago Hoboken ]                     |       |       |        +-----------+       |       +--------------+       |                   |                      |       v                   v                      v[ Aptos Boston ]   [ Denver Detroit ]   [ San-Jose Seattle ] |     |      |     |      |       |     |        |       | v     v      v     v      v       v     v        v       v                    X</pre>To find the key "Dallas", we begin searching at the top "root" node.  "Dallas" is not in the node but sorts between "Chicago" and "Hoboken", so we follow the middle pointer to the next node.  Again, "Dallas" is not in the node but sorts before "Denver", so we follow that node's first pointer down to the next node (marked with an "X").  Eventually, we will either locate the key, or encounter a "leaf" node at the bottom level of the B-tree with no pointers to any lower nodes and without the key we want, indicating the key is nowhere in the B-tree.<p>Below is another fragment of an order 1 B-tree (every node has at least 1 key and 2 pointers).  Searching for the key "Chicago" begins at "Marin", follows the first pointer to "Aptos" (since Chicago sorts before Marin), then follows that node's second pointer down to the next level (since Chicago sorts after Aptos), as marked with an "X".<pre>          |           v       [ Marin ]         |     |    +--+     +---+    |            |    v            v[ Aptos ]   [ Seattle ] |     |     |       | v     v     v       v        X</pre>Searching a B-tree for a key always begins at the root node and follows pointers from node to node until either the key is located or the search fails because a leaf node is reached and there are no more pointers to follow.<p>B-trees grow when new keys are inserted.  For example, here is an order 2 B-tree with integer keys.  Order 2 requires every node to have from 2 to 4 keys and 3 to 5 pointers:<pre>                                    [ 57 .. .. ..]                                     |  |                     +---------------+  +--------------------------+                     |                                             |                     v                                             v              [ 14 40 .. ..]                                [ 72 84 .. ..]               |  |  |                                       |  |  |      +--------+  |  +--------------+              +---------+  |  +-------------+      |           |                 |              |            |                |      v           v                 v              v            v                v[01 12 .. ..]  [15 16 17 ..]  [47 56 .. ..]  [58 60 61 ..]  [74 75 76 78]  [85 86 99 ..]</pre>To insert the key "59", we first simply search for that key.  If 59 is found, the key is already in the tree and the insertion is superfluous.  Otherwise, we must end up at a leaf node at the bottom level of the tree where 59 would be stored.  In the above case, the leaf node contains 58, 60, 61, and room for a fourth key, so 59 is simply inserted in the leaf node in sorted order:<pre>      |      v [58 59 60 61]</pre>Now we'll insert the key "77".  The initial search leads us to the leaf node where 77 would be inserted, but the node is already full with 4 keys:  74, 75, 76, and 78.  Adding another key would violate the rule that order 2 B-trees can't have more than 4 keys.  Because of this "overflow" condition, the leaf node is split into two leaf nodes.  The leftmost 2 keys are put in the left node, the rightmost 2 keys are put in the right node, and the middle key is "promoted" by inserting it into the parent node above the leaf.  Here, inserting 77 causes the 74-75-76-78 node to be split into two nodes, and 76 is moved up to the parent node that contained 72 and 84:<pre>Before inserting 77                    After inserting 77  [ 72 84 .. ..]                         [ 72 76 84 ..]   |  |  |                                |  |  |  |  -+  |  +-                             --+  |  |  +--      |                                      |  |      |                                 +----+  +------+      |                                 |              |      v                                 v              v[74 75 76 78]                     [74 75 .. ..]  [77 78 .. ..]</pre>In this case, the parent node contained only 2 keys (72 and 84), leaving room for 76 to be promoted and inserted.  But if the parent node was also already full with 4 keys, then it too would have to split.  Indeed, splitting may propagate all the way up to the root node.  When the root splits, the B-tree grows in height by one level, and a new root with a single promoted key is formed.  (This also means the root node, unlike all other nodes, is allowed to have fewer than n keys and fewer than 2n pointers.)<p>B-trees shrink when keys are deleted.  To delete a key, first perform the usual search operation to locate the node containing the key.  (If the key isn't found, it isn't in the tree and can't be deleted.)<p>If the found key is not in a leaf, move it to a leaf by swapping the key with the logical "next" key.  In a B-tree, the "next" key is always the first key in the leftmost leaf of the right subtree.<p>For example, in this B-tree we want to delete "37", which is not in a leaf:<pre>           [ xx 37 xx xx ]                  |                  v           [ xx xx xx xx ]            |            v     [ xx xx xx xx ]      |      v[41 43 .. ..]</pre>We follow the pointer to the right of 37 to find 37's right subtree, then follow the leftmost pointers in each subnode until we reach a leaf.  The first key in the leaf is "41", the logical "next" key after 37 in the list of keys.  By swapping 37 and 41, we can move 37 to a leaf node to set up a deletion without violating the key and pointer order of the overall B-tree.<p>Once the key we want is in a leaf, we can delete it.  If at least n keys remain in the node, we're done, otherwise it is an "underflow", since every node (except the root) must have at least n keys.<p>If a node underflows, we may be able to "redistribute" keys by borrowing some from a neighboring node.  For example, in the order 3 B-tree below, the key 67 is being deleted, which causes a node to underflow since it only has keys 66 and 88 left.  So keys from the neighbor on the left are "shifted through" the parent node and redistributed so both leaf nodes end up with 4 keys:<pre>          Before deleting 67                             After deleting 67              [ xx 55 xx ]                                  [ xx 33 xx ]                  |  |                                          |  |         +--------+  +--------+                        +--------+  +--------+         |                    |                        |                    |         v                    v                        v                    v[22 24 26 28 33 44]  [66 67 88 .. .. ..]      [22 24 26 28 .. ..]  [44 55 66 88 .. ..]</pre>But if the underflow node and the neighbor node have less than 2n keys to redistribute, the two nodes will have to be combined.  For example, here key 52 is being deleted from the B-tree below, causing an underflow, and the neighbor node can't afford to give up any keys for redistribution.  So one node is discarded, and the parent key moves down with the other keys to fill up a single node:<pre>       Before deleting 52              After deleting 52        [ 35 45 55 .. ]                 [ 35 55 .. .. ]         |  |  |  |                      |  |  |        -+  |  |  +-                    -+  |  +-            |  |                            |      +-----+  +-----+                      |      |              |                      |      v              v                      v[40 42 .. ..]  [50 52 .. ..]          [40 42 45 50]</pre>In the above case, moving the key 45 out of the parent node left 2 keys (35 and 55) remaining.  But if the parent node only had n keys to begin with, then the parent node also would underflow when the parent key was moved down to combine with the leaf key.  Indeed, underflow and the combining of nodes may propagate all the way up to the root node.  When the root underflows, the B-tree shrinks in height by one level, and the nodes under the old root combine to form a new root.<p>The payoff of the B-tree insert and delete rules are that B-trees are always "balanced".  Searching an unbalanced tree may require traversing an arbitrary and unpredictable number of nodes and pointers.<pre>An unbalanced tree of 4 nodes              A balanced tree of 4 nodes[ x x ]                                              [ x x ]     |                                                | | |    [ x x ]                                    +------+ | +------+         |                                     |        |        |        [ x x ]                             [ x x ]  [ x x ]  [ x x ]             |            [ x x ]</pre>Searching a balanced tree means that all leaves are at the same depth.  There is no runaway pointer overhead.  Indeed, even very large B-trees can guarantee only a small number of nodes must be retrieved to find a given key.  For example, a B-tree of 10,000,000 keys with 50 keys per node never needs to retrieve more than 4 nodes to find any key.<hr><A HREF="btp.html">B-TREE-P</A> copyright &copy 1987-1999 by <A HREF="/home/contact.html">Semaphore Corporation</A>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产尿小便嘘嘘尿| 色婷婷综合中文久久一本| 国产在线播精品第三| 成年人国产精品| 欧美日韩精品电影| 国产欧美精品日韩区二区麻豆天美| 亚洲品质自拍视频| 美国av一区二区| 91年精品国产| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 欧美精品精品一区| 精品对白一区国产伦| 亚洲六月丁香色婷婷综合久久| 蜜桃免费网站一区二区三区| 99久久国产综合精品色伊| 日韩午夜电影在线观看| 亚洲欧美偷拍另类a∨色屁股| 青青草国产成人99久久| 99国产精品99久久久久久| 精品乱人伦一区二区三区| 亚洲一二三四在线观看| 成人精品视频一区二区三区| 日韩手机在线导航| 一区二区免费在线| 成人精品免费视频| 精品噜噜噜噜久久久久久久久试看| 亚洲一区二区影院| 99精品国产热久久91蜜凸| 国产午夜精品久久久久久久| 日本欧美在线观看| 在线免费一区三区| 亚洲色图欧美偷拍| 不卡视频在线看| 国产亚洲精品7777| 国产九色sp调教91| 精品粉嫩aⅴ一区二区三区四区| 午夜欧美视频在线观看| 色婷婷综合激情| 综合久久久久久久| 成人深夜视频在线观看| 久久久久久电影| 激情文学综合插| 日韩欧美国产一区二区在线播放| 亚洲午夜久久久久| 国产视频一区二区在线| 天天操天天干天天综合网| 一本久道中文字幕精品亚洲嫩| 中文子幕无线码一区tr| 国产麻豆精品在线| 久久久久久久综合日本| 免费av网站大全久久| 日韩欧美综合在线| 久久国产精品一区二区| 欧美电影免费观看完整版| 美腿丝袜亚洲色图| 精品对白一区国产伦| 国产裸体歌舞团一区二区| 欧美电影免费观看完整版| 黑人巨大精品欧美黑白配亚洲| 欧美成人性福生活免费看| 精品一区二区在线免费观看| 久久久噜噜噜久久人人看 | 黑人巨大精品欧美一区| 精品久久一二三区| 国产盗摄女厕一区二区三区 | 欧美日本精品一区二区三区| 亚洲午夜久久久久| 51精品秘密在线观看| 欧美bbbbb| 国产人久久人人人人爽| 成人一区在线看| 亚洲免费观看高清完整版在线观看熊| 色婷婷激情久久| 午夜精品福利在线| 日韩一区二区三| 国产成人精品免费| 一区二区三区免费| 日韩精品一区二区三区四区| 成人综合激情网| 亚洲福利电影网| 久久综合狠狠综合| 91免费看视频| 日本成人中文字幕| 中文字幕亚洲一区二区va在线| 精品视频在线免费看| 激情偷乱视频一区二区三区| 亚洲天堂精品视频| 日韩一区二区三区精品视频| 国产成人av电影在线播放| 亚洲一区欧美一区| 国产亚洲精品aa午夜观看| 欧美亚洲综合在线| 国产一区二区精品在线观看| 1024精品合集| 26uuu亚洲综合色| 欧美这里有精品| 国产乱码精品一区二区三| 亚洲日本护士毛茸茸| 精品国产乱码久久久久久影片| 色婷婷精品大视频在线蜜桃视频| 日本美女视频一区二区| 欧美成人精品二区三区99精品| 9l国产精品久久久久麻豆| 美女在线视频一区| 亚洲图片有声小说| **欧美大码日韩| 久久久99精品免费观看不卡| 欧美乱妇23p| 日本高清免费不卡视频| 国产高清视频一区| 日韩高清在线观看| 亚洲精品国久久99热| 精品噜噜噜噜久久久久久久久试看| 91国偷自产一区二区三区成为亚洲经典 | 国模大尺度一区二区三区| 亚洲一区二区三区不卡国产欧美 | 欧美三级在线视频| av在线不卡免费看| 国产一区不卡精品| 日韩精品国产欧美| 亚洲一区在线免费观看| 国产精品福利影院| 欧美一区二区性放荡片| 欧美日韩日日夜夜| 在线精品国精品国产尤物884a| 成人精品视频网站| 国产精品一区二区视频| 另类成人小视频在线| 日韩在线a电影| 日韩国产欧美三级| 日韩中文字幕亚洲一区二区va在线| 夜色激情一区二区| 亚洲最新视频在线播放| 亚洲人吸女人奶水| 亚洲欧美偷拍卡通变态| 亚洲日本护士毛茸茸| 亚洲四区在线观看| 中文字幕一区二区三区四区| 国产精品每日更新| 最新高清无码专区| 亚洲欧美日韩久久| 亚洲精品免费看| 亚洲成年人网站在线观看| 亚洲成人黄色小说| 热久久久久久久| 国内国产精品久久| 高清不卡一二三区| 99精品欧美一区二区三区综合在线| 91在线国产福利| 欧美亚洲一区三区| 欧美一区二区三区喷汁尤物| 日韩精品一区二区三区在线| 2023国产精品| 国产精品女同互慰在线看| 国产精品国产三级国产| 亚洲女人的天堂| 亚洲成人免费电影| 美洲天堂一区二卡三卡四卡视频| 久久精品国产亚洲高清剧情介绍| 精品一区二区久久久| 国产成人在线视频免费播放| 波波电影院一区二区三区| 欧美视频日韩视频在线观看| 日韩亚洲欧美成人一区| 亚洲国产精品二十页| 一区二区在线观看免费视频播放| 亚洲一区二区三区中文字幕| 日韩电影免费在线看| 国产美女精品一区二区三区| 成人丝袜高跟foot| 欧美日韩激情在线| 26uuu亚洲综合色| 亚洲欧洲国产日韩| 美女在线一区二区| 91一区二区在线观看| 日韩视频免费直播| 一区精品在线播放| 蜜桃久久久久久久| 91免费看片在线观看| 精品sm在线观看| 亚洲一区二区三区国产| 国产成人综合在线观看| 欧美视频一区二区三区四区| 久久久久青草大香线综合精品| 亚洲免费毛片网站| 国产美女娇喘av呻吟久久| 欧美在线免费观看视频| 久久久久久久免费视频了| 亚洲国产精品尤物yw在线观看| 狠狠色狠狠色综合系列| 色婷婷久久久亚洲一区二区三区| 精品91自产拍在线观看一区| 亚洲精品国产视频| 成人毛片视频在线观看| 日韩美女一区二区三区| 一区二区三区欧美视频| 成人在线综合网| 久久综合精品国产一区二区三区| 午夜久久久久久久久| 99国产精品久|