原书出处
Introduction to Algorithms, Fourth Edition
17 第17章 数据结构的扩张
to the underlying red-black tree are caused by rotations, of which there are at most two.
Moreover, a rotation is a local operation: only two nodes have their size attributes invalidated. The link around which the rotation is performed is incident on these two nodes. Referring to the code for LEFT-ROTATE(T, x) on page 336, add the following lines: 13 y.size = x.size 14 x.size = x.left.size + x.right.size + 1
Figure 17.2 illustrates how the attributes are updated. The change to RIGHT-ROTATE is sym
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Introduction to Algorithms, Fourth Edition/_epub-src/OEBPS/chapter017.xhtml
EPUB SHA-256:ec7ced04bb875b93983816aef7a667855a4b71c5cf53b63406b9439c74e27aea