Skip to content

Instantly share code, notes, and snippets.

@lectricas
Created April 15, 2021 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lectricas/8838146b18f3e5316bfa981ea443cf5b to your computer and use it in GitHub Desktop.
Save lectricas/8838146b18f3e5316bfa981ea443cf5b to your computer and use it in GitHub Desktop.
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