Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Left rotation

Left rotation refers to the following

  • In an array, moving all items to the next lower location. The first item is moved to the last location, which is now vacant.
  • In a list, removing the head and inserting it at the tail.
  • In machine code (and assembly language) moving all bits in a register to the left, with the leftmost (most significant bit) becoming the rightmost.
We don't have any images related to Left rotation yet.
We don't have any YouTube videos related to Left rotation yet.
We don't have any PDF documents related to Left rotation yet.
We don't have any Books related to Left rotation yet.
We don't have any archived web articles related to Left rotation yet.

Tree rotation

Further information: Tree rotation

In a binary search tree, a left rotation is the movement of a node, X, down to the left. This rotation assumes that X has a right child (or subtree). X's right child, R, becomes X's parent node and R's left child becomes X's new right child. This rotation is done to balance the tree; specifically when the right subtree of node X has a significantly (depends on the type of tree) greater height than its left subtree.

Left rotations (and right) are order preserving in a binary search tree; it preserves the binary search tree property (an in-order traversal of the tree will yield the keys of the nodes in proper order). AVL trees and red–black trees are two examples of binary search trees that use the left rotation.

A single left rotation is done in O(1) time but is often integrated within the node insertion and deletion of binary search trees. The rotations are done to keep the cost of other methods and tree height at a minimum.