You're not updating the parent pointer of each node during the rotation, so you end up with a messed up graph that doesn't respect the assumptions
IF node->right != null THEN node->right->parent == node
IF node->left != null THEN node->left->parent == node
I tried implementation zig like this, and tried testing for an splay tree 5->4->3, in which i find(3) and therefor has to splay it to the root using zigzig.
but for some reason is the node 4 missing when the splaying is done, i've tried fixing with if's but it becomes more and more an hardcoded solution rather than general solution.. Could anyone help with a solution to keep node containing value 4 in the splay tree??