RBTree的几种变色和旋转情况

RBTree的旋转情况 大体可以分为两类 1. 不需要旋转的 cur,parent,uncle为红 grandfather为黑 只需要将parent,uncle变为黑,grandfather变为红,这个树便调整完毕 2. 需要左右旋转的 (1)cur,parent为红,grandfather为黑,uncle不存在或者为黑 且parent为grandfather左,cur为parent左,起始树图:
相关文章
相关标签/搜索