Created
April 15, 2021 15:01
-
-
Save lectricas/8838146b18f3e5316bfa981ea443cf5b to your computer and use it in GitHub Desktop.
This file contains 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
void print_range(Node *root, int L, int R) { | |
if (root == nullptr) { | |
return; | |
} | |
print_range(root->left, L, R); | |
if (root->value <= R && root->value >= L) { | |
cout << root->value << "\n"; | |
} | |
print_range(root->right, L, R); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment