Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int trav(int key, node root) {
- if (root == null) {
- return 0;
- }
- if (root.left != null) {
- trav(key, root.left);
- }
- if (root.right != null) {
- trav(key, root.right);
- }
- if (root.right == null && root.left == null) {
- System.out.println("Key " + root.key);
- }
- return root.key;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement