AVL樹的右旋html
AVL樹的右左旋git
問題1:.紅黑樹從任一節點到其每一個葉子的全部路徑都包含相同數目的黑色節點這句話怎麼理解?中間的狀況是否與這句話有出入?算法
問題1解決方案:這有個條件:確保沒有一條路徑會比其餘路徑長出倆倍數組
問題2解決方案:在紅黑樹的刪除算法中,有這麼一種狀況
這種狀況下,S的左孩子與右孩子必爲NIL,不然原來的紅黑樹就不平衡.
那麼在對P的向上遞歸過程當中,也會出現這種狀況,即對應的S及S的孩子全爲黑色.
NIL結點的意義就在於:向上遞歸的過程當中識別出這種狀況數據結構
無less
There are four basic methods for traversing a tree: preorder, inorder, postorder, and level-order.post
B . Top down, inorder, postorder, and level-order學習
C . Bottom up, preorder, in order, and postorder.net
D . preorder, inorder, postorder, and level-order
選D,看錯設計
The simulated link strategy does not allow array positions to be allocated contiguously regardless of the completeness of the tree.
A . True
B . False
選B,模擬連接策略容許連續分配數組位置而不用考慮該樹的徹底性。
In general, a balanced n-ary tree with m elements will have height lognm.
A . True
B . False
選A,具備m個元素的平衡n元樹的高度爲lognm
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 30篇 | 400小時 | |
第一週 | 0/0 | 1/1 | 8/8 | |
第二週 | 500/500 | 1/2 | 15/ 23 | |
第三週 | 802/1302 | 1/3 | 12/35 | |
第四周 | 1530/2832 | 2/5 | 15/50 | |
第五週 | 1165/3997 | 1/6 | 10/60 | |
第六週 | 1169/5166 | 1/7 | 15/75 | |
第七週 | 843/6039 | 1/8 | 15/90 |