Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Return the size of the BST (total number of nodes) */
- public int size() {
- return size(root); // 1
- }
- /* Private size() method */
- private int size(Node<Key, Value> x) {
- if (x == null) { // 2
- return 0; // 2
- }
- return x.size; // 3
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement