Created
April 22, 2025 14:37
-
-
Save fabianbaechli/7c4a23cfa4014bdd908d362b68c595f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct node* BSTreeSuccAbove(struct node* p, struct node* x) { | |
struct node* succ = NULL; | |
while (p != x) { | |
if (x->key < p->key) { | |
succ = p; | |
p = p->lft; | |
} else if (x->key > p->key) { | |
p = p->rgt; | |
} | |
} | |
return succ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment