資工期中超渡團
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    4
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: 進階資料結構(期末) --- # CH 9 Heap ## Min-Max heap ### Definition * A mix-max heap is a complete binary tree such that if it is not empty, each element has a field called key. * Alternating levels of this tree are min levels and max levels, respectively. * Let x be any node in a min-max heap. If x is on a min (max) level then the element in x has the minimum (maximum) key from among all elements in the subtree with root x. We call this node a min (max) node. * example![](https://i.imgur.com/rgSREu4.png) * 樹中為min-heap的部分,仍需符合min-heap的特性 * 如圖Level 1的節點鍵值,會小於Level為3的子樹(10小於19、13、18、15) * 樹中為max-heap的部份,仍需符合max-heap的特性 * 如圖的Level 2的節點鍵值,會大於Level為4之子樹(40大於32、28、34、31;45大於24、35、42、33) ### Insertion of Min-Max heap * Step 1 * 將欲新增的元素插入 Min-Max Heap 最後一個節點 * Step 2 * 將新增節點與其父節點做比較,若父節點位於 Min (Max) Level,且新增節點小於 (大於) 父節點,則交換二者的位置。 * Step 3 * 若交換後新增節點的位於 Min (Max) Level,則依序往上與各 Min (Max) Level 的節點比較,若新增節點較小(大),則二者交換。 * Step 4 * 重複 Step 3,直至不能再交換或到 root 為止。 ### Deletion of Min-Max heap #### Delete Min 1. Step1: 移走 root 資料 2. Step2: 將 heap 的 last-node X 插入 step1 後的 heap 中 * Case1 : Root 沒有任何 child : X 插入 root 位置 * Case2 : Root 只有 children 沒有 grandchild 令 children 中最小值為 k 若 k < X 則將 X 與 k 互換位置 否則將 X 插入 root 位置 * Case3 : Root 有 grandchildren 令 grandchildren 中最小值為 k 且 k 之 parent 為 p 若 k < X 則 K 移到 X 的位子 若 X > p 則 X 與 p 的值互換 重複 step2 否則將 X 插入 root 位置 * Example * Start![](https://i.imgur.com/wUACOdP.png) * Result![](https://i.imgur.com/dB4s18n.png) 1. Step1: 若只有一個 node 則移走 root , 結束 否則移走 root 之 children 之最大者,進行 step2 2. Step2: 將 heap 的 last-node X 插入 step1 後的 heap 空位中(並視為Root) * Case1 : 此位置沒有任何 child : X 插入此位置 * Case2 :此位置只有 children 沒有 grandchild 令 children 中最大值為 k 若 k > X 則將 X 與 k 互換位置 否則將 X 插入 root 位置 * Case3 :此位置有 grandchildren 令 grandchildren 中最大值為 k 且 k 之 parent 為 p 若 k > X 則 K 移到 X 的位子 若 X < p 則 X 與 p 的值互換 重複 step2 否則將 X 插入 root 位置 * Example * Start!![](https://i.imgur.com/uEZOdBj.png) * Result![](https://i.imgur.com/Xpj9SZe.png) ### 練習 * (a) Insert 8, 16, 33, 46,61, 5, 13 (b) Delete-Min, Delete-Max, Delete-Max, Delete-Max, Delete-Max, Delete-Max, ![](https://i.imgur.com/6L1ZhJE.png) > [如果有錯誤,請在留言中告知網址] ![](https://i.imgur.com/MAjx7rc.jpg) ### 考題 [**99年 考Min-Max heap 定義**](#Definition) ## Deap * Definition: A deap is a complete binary tree that is either empty or satisfies the following properties: 1. The root contains no element 2. The left subtree is a min heap 3. The right subtree is a max heap 4. If the right subtree is not empty, then let i be any node in the left subtree. Let j be the corresponding node in the right subtree. If such a j does not exist, then let j be the node in the right subtree that corresponds to the parent of i. The key in node i is less than or equal to that of j (i.e. i.key <= j.key) ![](https://i.imgur.com/UOvcO3D.png) ### 對應點 * If i is a node in the min heap of the deap, its corresponding node in the max heap is j * j is defined in property (4) of definition is given by * $j = i+2^{\lfloor log_2i\rfloor-1}$ * $if(j<n+1)j/=2 \space$ (如果對應點不存在,對應點位原對應點的Parent) ![](https://i.imgur.com/JIcPXNp.png) ### Deap insert * Deap 的加入動作與其它堆積樹一樣,將新的鍵值加入於整棵樹的最後,再調整至符合堆積樹的定義 * 假設已存在一 Deap 如下 ![](https://i.imgur.com/KjcuKim.png) * 若加入25,加入後右子樹仍為一棵max-heap,如下所示,且左子樹對應節點15小於等於它所對應的右子樹節點25,符合deap的定義 ![](https://i.imgur.com/9aVV6L1.png) * 加入17,加入後的圖形如下所示 ![](https://i.imgur.com/j86o85v.png) * 此時右子樹仍為max-heap,但17小於其左子樹的對應節點20,故將17與20交換 ![](https://i.imgur.com/GIVuOmn.png) * 加入40,如下所示 ![](https://i.imgur.com/Cy50NAU.png) * 加入後左子樹雖為min-heap,但40大於其對應節點25(與節點40的父節點對應之右子樹節點),不符合deap的定義,故將40與25交換,如下所示: ![](https://i.imgur.com/XAh4EYl.png) * 交換後樹中的右子樹不是一棵max-heap,重新將其調整為max-heap即可 ![](https://i.imgur.com/ViJjYri.png) --- * 額外範例 ![](https://i.imgur.com/jeRKRzd.png) * 加入4之後 ![](https://i.imgur.com/I2xW7VZ.png) * 加入30之後 ![](https://i.imgur.com/Gi85KK3.png) ### Deap deletion #### Delete Min * Suppose we want to remove the minimum element from the deap 1. We first place the last element into a temporary element t. 2. Vacancy created by the deletion of the min element is filled by moving from position 2 to a leaf 3. Each move is preceded by a step that moves the smaller of the elements in the children of the current node up 4. Then move to the position previously occupied by the moved element 5. Repeat the process until we move the empty node to a leaf position 6. Compare the key put in the temporary element with the max partner 7. If <, no exchange is needed. The temporary element is inserted into the empty leaf node 8. If >, exchange them ![](https://i.imgur.com/vkISGo4.png) ### 練習 * (a). Insert 4, 80, 52, 11 (b) Delete-min, Delete-min, Delete-max, Delete-max ![](https://i.imgur.com/aidLqhe.png) ### 考題 * 99年 ![](https://i.imgur.com/dMVBsqW.png) ![](https://i.imgur.com/hU1mQ0A.png) > [如果有錯誤,請在留言中告知] > ![](https://i.imgur.com/69lsgk7.jpg) ## Leftist Trees * Leftist trees are defined using the concept of an extended binary tree. An extended binary tree is a binary tree in which all empty binary subtrees have been replaced by a square node * The square nodes in an extended binary tree are called external nodes. The original nodes of the binary tree are called internal nodes ### Shortest(x) * Let x be a node in an extended binary tree. Let LeftChild(x) and RightChild(x), respectively, denote the left and right children of the internal node x * Define shortest(x) to be the length of a shortest path from x to an external node. It is easy to see that shortest(x) satisfies the following recurrence: ![](https://i.imgur.com/HC1IyCc.png) ![](https://i.imgur.com/cCi0bQr.png) ### Definition * A leftist tree is a binary tree such that if it is not empty, then shortest(LeftChild(x)) ≥ shortest(RightChild(x)) for every internal node x * Lemma: Let x be the root of a leftist tree that has n (internal) nodes * (a) n ≥ 2shortest(x) – 1 * (b) The rightmost root to external node path is the shortest root to external node path. Its length is shortest(x). #### Min (Max) Leftist tree * Definition: A min leftist tree (max leftist tree) is a leftist tree in which the key value in each node is no larger (smaller) than the key values in its children (if any). In other words, a min (max) leftist tree is a leftist tree that is also a min (max) tree ### Operations * Like any other tree structures, the popular operations on the min (max) leftist trees are insert, delete, and combine * The insert and delete-min operations can both be done by using the combine operation 1. To insert an element x into a min leftist tree, we first create a min leftist tree that contains the single element x. Then we combine the two min leftist trees 2. To delete the min element from a nonempty min leftist tree, we combine the min leftist trees root->LeftChild and root->RightChild and delete the node root. 3. To combine two leftist trees: 1. a new binary tree containing all elements in both trees is obtained by following the rightmost paths in one or both trees 2. Next, the left and right subtrees of nodes are interchanged as necessary to convert this binary tree into a leftist tree * The complexity of combining two leftist trees is O(log n) ### Combine * 挑出a、b之root的最小值作為新樹之root(令a為最小) * A之root為新樹之root,且a之左子樹保留,將a之右子樹與b合併 * 重複前兩個步驟,直到合併完成。 * 檢查有無滿足min leftist tree性質,若沒有,則要對調左右子樹來調整 ![](https://i.imgur.com/puWWCYh.png) ![](https://i.imgur.com/7WYW3FD.png) ### Exercise * combine ![](https://i.imgur.com/vCvr2WG.png) * answer * ![](https://i.imgur.com/k3mk45W.png) ### 考題 * 99年 * [Definition](#Definition) * combine ![](https://i.imgur.com/JMqvjcA.png) > [有錯誤請告知] ![](https://i.imgur.com/DZzNmnr.jpg) ## Binomial tree * Binomial tree Bk is an ordered tree defined recursively. ![](https://i.imgur.com/sJeSzpF.png) * Bk is degree k binomial tree. ![](https://i.imgur.com/tgYg5ct.png) * Bk , k > 0, is: ![](https://i.imgur.com/MhTDHYh.png) * Lemma (Properties of binomial trees) * For each binomial tree Bk * There are 2k nodes * The height of the tree is k * There are exactly k! / i!(k-i)! nodes at depth i * The root has degree k, which is greater than that of any other node Theorem: The height of Bk , the binomial tree of order k, is k Theorem: The number of nodes at level l in , the binomial tree of order k, where 0≦ l ≦ k , is given by the binomial coefficient C k取l ### Number of Nodes in Bk * Nk = number of nodes in Bk. * N0 = 1 ![](https://i.imgur.com/11OIWdG.png) * Bk , k > 0, is: ![](https://i.imgur.com/QktANls.png) * Nk = N0 + N1 + N2 + …+ 1 = 2k. ### Equivalent Definition * Bk , k > 0, is two Bk-1s. * One of these is a subtree of the other. ![](https://i.imgur.com/YQwTJ9Y.png) N0 = 1 Nk = 2N(k-1) = 2^k. If we start with zero elements and perform operations as described, then all trees in all binomial heaps are binomial trees. So, MaxDegree = O(log n). ![](https://i.imgur.com/gJouTf3.png) ![](https://i.imgur.com/0l02uxH.png) ## Binomial heap(B-heap) ![](https://i.imgur.com/myQsI9i.png) ![](https://i.imgur.com/dcSCx5G.png) ### Definition * Node: degree, child ,left_link, right_link, data, parent * roots are doubly linked * a points to smallest root * B0 has exactly one node * Bk, k > 0, consists of a root with degree k and whose subtrees are B0, B1, …, Bk-1 * Bk has exactly 2k nodes ![](https://i.imgur.com/evhQJf8.png) ![](https://i.imgur.com/9Kr6j0u.png) ### Operations #### Insert * Insertion Into a Binomial Heap * make a new node into doubly linked circular list pointed at by a * set a to the root with smallest key #### Combine * Combine two B-heaps a and b * combine two doubly linked circular lists to one * set a to the root with smallest key #### Delete * 一般刪除的動作乃是擷取此棵Binomial heap的最小值出來,因此只要從head[H]指向的鏈結串列中就可找到最小的值在那一棵Binomial tree,此時將此節點刪除之即可 ### Cost * insert and combine is O(1), and that of each delete-min operation is O(log n) ## What’s BH&FH -- Definition( Important) * A binomial heap is a collection of binomial trees. * The binomial tree Bk is an ordered tree defined recursively. The binomial tree B0 consists of a single node. The binomial tree Bk consists of two binomial trees Bk-1 that are linked together: the root of one is the leftmost child of the root of the other. * Like a binomial heap, a Fibonacci heap is a collection of min-heap-ordered trees. The trees in a Fibonacci heap are not constrained to be binomial trees. * Binomial heap is a special case Fibonacci heap * Binomial heap node: data, link, degree and child * Fibonacci heap node: data, parent, childcut, child, link and degree. ### 考題 99年 ![](https://i.imgur.com/GrPvPyx.png) ## Fibonacci Heaps(F-heaps) ### Definition * A Fibonacci heap is a data structure that supports the three binomial heap operations: insert, delete-min (or delete-max),and combine, as well as the following additional operations: * (1) decrease key: Decrease the key of a specified node by a given positive amount * (2) delete: Delete the element in a specified node * this two operations are followed by cascading cut * Two varieties of Fibonacci heaps: * Min Fibonacci heap: is a collection of min trees * Max Fibonacci heap: is a collection of max trees * B-heaps are a special case of F-heaps. ![](https://i.imgur.com/ENMNkw3.png) ### Operations #### Delete * Follow the below steps to delete a node b from an F-heap: * If min = b, then do a delete-min; otherwise do Steps 2, 3, and 4 below * Delete b from its doubly linked list * Combine the doubly linked list of b’s children with the doubly linked list pointed at by min into a single doubly linked list. Trees of equal degree are not joined as in a delete-min operation * Dispose of node b * Example: delete 12 ![](https://i.imgur.com/99eUJMz.png) ![](https://i.imgur.com/nTiyfAC.png) #### Decrease Key * To decrease the key in node b, do the following: * (1) Reduce the key in b * (2) If b is not a min tree root and its key is smaller than that in its parent, then delete b from its doubly linked list and insert it into the doubly linked list of min tree roots * (3) Change min to point to b if the key in b is smaller than that in min. ![](https://i.imgur.com/O707JiG.png) #### Cascading cut ![](https://i.imgur.com/JABq0GZ.png) * whenever a delete or decrease-key operation deletes a node q that is not a min tree root from its doubly linked list, then the cascading cut step is invoked * If two children of x were deleted, then x must be cut and moved to the ring of roots.(Important) #### Extract Min ![](https://i.imgur.com/JH8poxN.png) ![](https://i.imgur.com/QBs7TKQ.png) ![](https://i.imgur.com/nyqV8fy.png) ![](https://i.imgur.com/u5Ys74X.png) ![](https://i.imgur.com/H4v3vdu.png) ![](https://i.imgur.com/Xk1eZ4C.png) ![](https://i.imgur.com/KhCyDEp.png) ![](https://i.imgur.com/vQ1VgaV.png) ![](https://i.imgur.com/2jlWHr2.png) ![](https://i.imgur.com/0PO3F40.png) ![](https://i.imgur.com/Xbioqhm.png) ![](https://i.imgur.com/8eSjOWi.png) ![](https://i.imgur.com/3lcaz3q.png) ![](https://i.imgur.com/g8SSkuL.png) ![](https://i.imgur.com/m2hvi7X.png) ### 考題 99 ![](https://i.imgur.com/YvxEyG5.png) Below figure is a Fabonacci heap on 10 keys, Note that it consists of two trees. If we apply the following sequence of 4???(老師算術不太好) operations: * delete-minimum * insert 15 * delete 44 * decrease 72 to 13 * delete 63 What will be the resulting Fibonocci heap for each operation? ![](https://hackmd.io/_uploads/rkR7D0tLh.png) > [誰會啊???有人能確認答案嗎?] ![](https://i.imgur.com/O1QX6eY.jpg) # ch10 ## Optimal binary search tree ### Path length * External(E):Sum over all external nodes of the lengths of the paths from the root to those nodes. * Internal(I): Sum over all internal nodes of the lengths of the paths from the root to those nodes. * Binary trees with maximum E also have maximum I. E=I+2n * For all binary trees with n internal nodes * $Maximum\space I=\sum_{i=0}^{n-1} i = n(n-1)/2\space (skew tree)$ * $Minimum\space I=\sum_{1\leq i\leq n}^{} \lfloor log_2i \rfloor (complete\space binary\space tree)$ ### Cost ![](https://i.imgur.com/HMWowbp.png) ![](https://i.imgur.com/wrmJzYM.png) #### Example ![](https://i.imgur.com/mtoi9dg.png) #### CODE ![](https://i.imgur.com/DdpK7nS.jpg) ### 考題 ![](https://i.imgur.com/46t6FgW.png) ## M way search tree * 節點的型態是n, A0, (K1, A1), (K2, A2),...,(Kn, An) 其中Ai是子樹的指標 0 ≤ i ≤ n < m; n為節點上的鍵值數,Ki是鍵值1 ≤ i ≤ n < m。 ![](https://i.imgur.com/gUyBont.png) ![](https://i.imgur.com/BtBlpTA.png) ### Maximum pairs * For 'm' way and height of 'h' * Maximum number of nodes = $1 + m + m^2 + m^3 ... m^{h-1} = m^h-1/(m-1)$ * Each node has $m – 1$ pairs. * Maximum number of pairs = $m^h-1$ * 2-3 tree: m = 3 * 2-3-4 tree: m = 4 ## 2-3 tree ### Definition * 何謂2-3 Tree? * 2-3 Tree 可以是空集合; * 若不是空集合,則要符合下列的定義 * 2-3 Tree中的節點可以存放一筆或兩筆資料。 * 若節點中存放了一筆資料Ldata,其必須存在兩個子節點 – 左子節點與中子節點。假設資料Ldata的鍵值為Ldata.key。 * 若節點中存放了兩筆資料Ldata與Rdata,則會存在三個子節點 – 左子節點、中子節點與右子節點 * 若節點中存放了兩筆資料Ldata與Rdata,則會存在三個子節點 – 左子節點、中子節點與右子節點。假設資料Ldata與Rdata的鍵值分別為Ldata.key與Rdata.key,則: * Ldata.key < Rdata.key * 左子節點所存放的資料鍵值必須小於Ldata.key * 中子節點所存放的資料鍵值必須大於Ldata.key,小於data.key * 右子節點所存放的資料鍵值必須大於Rdata.key ### Insertion * 從2-3 Tree的開始搜尋,假使加入的資料其鍵值在2-3 Tree中找不到(不可有相同的節點資料存在同一個2-3 Tree中),則加入2-3 Tree中。 * 假設加入的節點,該節點只有一筆資料,則直接加入; * 該節點已存在兩筆資料,加入後不符合2-3 tree的定義,因此必須將此節點資料一分為二,分別放入最大鍵值和最小鍵值並將中間的鍵值,往上放到父節點。 * 該節點的父節點也已有二筆資料,先將該節點一分為二,並將中間資料往上提及父節點,接著重覆此步驟來調整父節點,直到符合2-3 tree為止 ![](https://i.imgur.com/zWLm6mE.png) ![](https://i.imgur.com/im15Nn7.png) ### Deletion * Tree的刪除分成兩部份: * 一為刪除的鍵值是在樹葉節點上(leaf node) * 二為刪除的鍵值是在非樹葉節點(non-leaf node) ![](https://i.imgur.com/hV1LImJ.png) ![](https://i.imgur.com/2XkrGGE.png) ![](https://i.imgur.com/JGQe6Jt.png) ![](https://i.imgur.com/ErtWDUl.png) ![](https://i.imgur.com/kfWfc0F.png) ![](https://i.imgur.com/KCFwRyu.png) ![](https://i.imgur.com/ZIm2Y0K.png) ![](https://i.imgur.com/tjl6W22.png) ![](https://i.imgur.com/jo7dBJn.png) ![](https://i.imgur.com/u2lGLCn.png) ### 考題 ![](https://i.imgur.com/S69CpxI.png) ![](https://i.imgur.com/4zf2gHz.jpg) ## 2-3-4 tree ![](https://i.imgur.com/dNQav1n.png) ![](https://i.imgur.com/zG2Cy4C.png) ![](https://i.imgur.com/bE6QQhg.png) ![](https://i.imgur.com/9lagJ5Q.png) ![](https://i.imgur.com/zW34Aav.png) ![](https://i.imgur.com/Li5YK05.png) ## B tree ### Definition ![](https://i.imgur.com/X4RVP6q.png) * 2-3 tree is B-tree of order 3. * 2-3-4 tree is B-tree of order 4. ### number of nodes * Maximum number of nodes = $1 + m + m^2 + m^3 ... m^{h-1} = m^h-1/(m-1)$ * Minimum number of nodes = $2\times\lceil m/2\rceil^{h-1}$ ### number of keys * maximum number of keys = $m^h-1$ * Minimum number of keys = $2\times\lceil m/2\rceil^{h-1}-1$ # 考試重點 ## CH 9 * Min-Max * Def * Insert * Delete Min Max * Deaps * Definition * Insert * Delete * Leftist * Definition * shortest * Combine * Binomial * tree Definition * heap * Fibonacci * 和Binomial的差異 * Delete * Reduction * extract min ## CH 10 * Binary search tree(一定考) * 程式(pseudo code) * 圖 * B-tree * Definition * children key數 order * delete 補位方向 * 2-3 tree degree * Insert * delete * 2-3-4 degree * key數 * M-WAY * 資料結構表示 * key 數 ###### tags: `CSnote`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully