全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Rotation?

Definition 17.7 University Computer Science — Year 1 · 第 17 章 — Binary Search Trees and Balanced Trees

A right rotation at a node yy with left child xx makes xx the root of the subtree, yy its right child, and the former right subtree of xx the left subtree of yy. A left rotation is the inverse operation.

A rotation changes three links. The in-order sequence is A, x, B, y, C on both sides; the subtree B (shaded) changes parent; A moves up a level and C down a level.
A rotation changes three links. The in-order sequence is A,x,B,y,CA, x, B, y, C on both sides; the subtree BB (shaded) changes parent; AA moves up a level and CC down a level.
在原文中阅读 →