These exercises demonstrate the content of the ByTheMark service. These are meant for private individuals for learning data structures and algorithms. If you want to try out more content, you can register to the ByTheMark Personal free of charge.

The AVL-tree below is out of balance after the last insertion (in the model solution you can see the state before and after the insertion). Balance the tree by making a rotation. See "Instructions" for more details.

Rotations can be made by modifying edges, ie. by drag&dropping the edges to point to a new node. The tree is updated when the Update References button is pressed. Do the update only after you have moved all the edges that should be changed in the rotation.

Each node is represented as a circle containing a letter (key field). The number beside each node tells the height of the subtree. If (by a mistake) triangle appears on the screen, it means that there is a cycle in the data structure, and it cannot be represented as a tree anymore.

The notation used is common in C language in which records a defined in terms of structs (i.e., "->" refers to a field in a struct). You can assume that the tree is defined as follows: