Skip to content

Instantly share code, notes, and snippets.

@Alexey-N-Chernyshov
Created October 28, 2015 19:43
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 Alexey-N-Chernyshov/569e4141ed3f3249329e to your computer and use it in GitHub Desktop.
Save Alexey-N-Chernyshov/569e4141ed3f3249329e to your computer and use it in GitHub Desktop.
//the second line for search
inStr = in.nextLine().trim().split(" ");
for (String str : inStr) {
if (!str.isEmpty()) {
RBTree.Node node = tree.find(Integer.parseInt(str));
node = node == null ? null : node.right;
out.print((node == null ? "null" : node.value) + " ");
System.out.print((node == null ? "null" : node.value) + " ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment