Left rotation

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.

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) greather 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.

References

*Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein, 2001, "Introduction to Algorithms", second edition. McGraw-Hill, ISBN 0-07-013151-1. Chapter 13.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Rotation of axes — is a form of Euclidean transformation in which the entire xy coordinate system is rotated in the counter clockwise direction with respect to the origin (0, 0) through a scalar quantity denoted by θ.With the exception of the degenerate cases, if a …   Wikipedia

  • Rotation (mathematics) — Rotation of an object in two dimensions around a point O. In geometry and linear algebra, a rotation is a transformation in a plane or in space that describes the motion of a rigid body around a fixed point. A rotation is different from a… …   Wikipedia

  • left´-hand´ed|ness — left hand|ed «LEHFT HAN dihd», adjective, adverb. –adj. 1. using the left hand more easily and readily than the right: »A left handed person who sews, often has trouble with regular scissors. 2. done with the left hand: »a left handed catch. 3.… …   Useful english dictionary

  • left´-hand´ed|ly — left hand|ed «LEHFT HAN dihd», adjective, adverb. –adj. 1. using the left hand more easily and readily than the right: »A left handed person who sews, often has trouble with regular scissors. 2. done with the left hand: »a left handed catch. 3.… …   Useful english dictionary

  • left-hand|ed — «LEHFT HAN dihd», adjective, adverb. –adj. 1. using the left hand more easily and readily than the right: »A left handed person who sews, often has trouble with regular scissors. 2. done with the left hand: »a left handed catch. 3. made to be… …   Useful english dictionary

  • Rotation (pool) — Rotation, sometimes called rotation pool or 61, is a pocket billiards (pool) game, requiring a standard pool table, Cuegloss|Cue ball|cue ball and triangular rack of fifteen pool balls, in which the lowest numbered Cuegloss|Object ball|object… …   Wikipedia

  • Left-handed — Left hand ed, a. 1. Having the left hand or arm stronger and more dexterous than the right; using the left hand and arm with more dexterity than the right. [1913 Webster] 2. Clumsy; awkward; unlucky; insincere; sinister; malicious; as, a left… …   The Collaborative International Dictionary of English

  • Left-handed marriage — Left handed Left hand ed, a. 1. Having the left hand or arm stronger and more dexterous than the right; using the left hand and arm with more dexterity than the right. [1913 Webster] 2. Clumsy; awkward; unlucky; insincere; sinister; malicious; as …   The Collaborative International Dictionary of English

  • Left-handed screw — Left handed Left hand ed, a. 1. Having the left hand or arm stronger and more dexterous than the right; using the left hand and arm with more dexterity than the right. [1913 Webster] 2. Clumsy; awkward; unlucky; insincere; sinister; malicious; as …   The Collaborative International Dictionary of English

  • Rotation matrix — In linear algebra, a rotation matrix is a matrix that is used to perform a rotation in Euclidean space. For example the matrix rotates points in the xy Cartesian plane counterclockwise through an angle θ about the origin of the Cartesian… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”