I am trying to implement the zig zag movement which and splay tree has.
i am kinda having a hard time doing so, all my solutions seems a bit hardcoded, and kinda looking for a universal solution.
Each node is defined by a struct which contains these informations
struct splay_node{
int value;
splay_node* left;
splay_node* right;
splay_node* parent;
};
And the tree itself is a class which is defined as