Skip to content

Instantly share code, notes, and snippets.

@wecing
Created February 5, 2013 10:57
Show Gist options
  • Save wecing/4713726 to your computer and use it in GitHub Desktop.
Save wecing/4713726 to your computer and use it in GitHub Desktop.
rotate right
int main () {
...
Node *root;
...
root = rotate_right(root);
...
}
Node *rotate_right(Node *n) {
Node *r = n->left;
n->left = r->right;
r->right = n;
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment