Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Rotation?

Definition 17.7 University Computer Science — Year 1 · Capítulo 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.
Ler no capítulo →