# Splay Tree Rotations

Last Updated on

Splay trees are binary search trees which are self-adjusted in which every operation on the element rearranges the trees so that, the element is placed at the root position of the tree

In a splay tree, every operation is performed at the root of the tree

all the operations in a splay tree are involved with the common operating called splaying

## Splaying

Splaying an element is the process of bringing the element to the root position by performing the suitable rotation operation

by splaying the elements closure to the root of the tree.so that, any operation on those elements is performed quickly i.e splaying operation automatically brings more frequently used elements to the root of the tree

Rotations of the splay trees

- Zig Rotation
- Zag Rotation
- Zig-Zig Rotation
- Zag-Zag Rotation
- Zig-Zag Rotation
- Zag-Zig Rotation

### Zig Rotation

Zig rotation in splay tree is similar to single R rotation in AVL trees in AVL tree. In this rotation, every node moves one position to the right from the current position

### Zag Rotation

Zag rotation in the splay tree is similar to single L rotation in AVL trees .in this rotation every node moves one position to the left from the current position

### Zig-Zig Rotation

In this rotation of splay trees is the double zig rotation in which every node moves two positions to the right from its current position

### Zag-Zag Rotation

In this rotation in the splay tree the double zag rotation in which every node moves two positions left to form its current position

### Zig-Zag Rotation

In this rotation of splay tree is the sequence of zig rotation followed by zag rotation.

In zig-zag rotation, every node moves one position to the right followed by one position to the left from its current position

### Zag-Zig Rotation

In this rotation of splay tree is the sequence of zag rotation followed by zig rotation.

In zig-zag rotation, every node moves one position to the left followed by one position to the right from its current position