Read the following recursive implementation for Fibonacci numbers and

**answer the below questions.****UPDATE:**You should show all the complete execution tree, including duplicate calls.`int f(int n) { if (n <= 1) return n; return f(n - 1) + f(n - 2); }`

- Show the execution tree tracing for f(5). Use backslash and forward slash to represent right and left children; also use sufficient enough spacing to make your answer readable!
- How many number of
**base case**calls are happening in this recursion? Or in other words, what is the work done? - How many unique number of calls are happening?

**Answer the following questions**regarding the following data structures:`i. 9 ii. 5 iii. 4 iv. 4 v. 10 / \ / /|\ / \ / \ 7 8 0 3 4 5 1 -2 3 12 / / \ / / \ 6 -5 2 1 4`

- Which are valid trees? (List all correct answers.)
- Which are valid binary trees? (List all correct answers.)
- Which are valid binary search trees (BSTs)? (List all correct answers.)
- List the nodes of tree v. above in the order in which a pre-order traversal would visit them.
- List the nodes of tree v. above in the order in which a post-order traversal would visit them.
- List the nodes of tree v. above in the order in which an in-order traversal would visit them.
- List the nodes of tree v. above in the order in which a level-order traversal would visit them.

- Consider the following implementation of a node in a binary tree:
`class BinaryTreenode<T> { private T data; private BinaryTreenode<T> leftChild; private BinaryTreenode<T> rightChild; public BinaryTreenode(T item) { data = item; leftChild = null; rightChild = null; } public T getData() { return data; } public BinaryTreenode<T> getLeft() { return leftChild; } public BinaryTreenode<T> getRight() { return rightChild; } ... }`

**Implement**the following**countLeaves**function that determines the number of leaves of the binary tree. Assume that first call to this function will be with*root node*.

**For full credit, your code:**- must not modify the tree.
- must not be more than 10 lines of code and may be fewer.

`class BinaryTree<T> { BinaryTreenode<T> root; public int countLeaves() { return countLeaves(root); } private int countLeaves(BinaryTreenode<T> node) { ... } }`

**Answer the following questions**about a standard binary search tree. Make sure that your tree is properly readable on the CSL machine.- Show the binary search tree that results from inserting the following
sequence of integers into a tree that is initially empty:
34, 32, 35, 37, 31, 36, 33, 38

- Show the binary search tree that results from inserting the following
sequence of integers into a tree that is initially empty:
9, 23, 12, 6, 10, 5, 14, 3, 1, 4

- Show the binary search tree (one of them would do) that results from deleting 32 from the tree in part a.
- Show the binary search tree (one of them would do) that results from deleting 9 from the tree in part b.

- Show the binary search tree that results from inserting the following
sequence of integers into a tree that is initially empty:
**Answer the following questions**about a binary tree with N nodes. Recall that a binary tree is**height-balanced**if, for every node, the height of the left or right subtree is at most one more than the height of the other subtree. Equivalently, the height of the tree is as small as possible.*Hint:*You will need the following mathematical functions:*floor and ceiling*. Try out different example cases before finializing your answer.- What is the maximum height of the tree?
- What is the maximum number of leaves?
- What is the
**approximate**maximum height of the tree if it is balanced? - What is the maximum number of leaves if the tree is
**height-balanced?**

- Consider the same implementation of a node in a binary tree as in question 3. Assume that you also have the following
**height**method implemented.

Complete the`class BinaryTree<T> { BinaryTreenode<T> root; public int height(BinaryTreenode<T> node) { //Assume this method is implemented for you } boolean isBalanced(BinaryTreenode<T> node) { ... //COMPLETE THIS METHOD } }`

**implementation**of**isBalanced**method that determines if the binary tree is**height-balanced**or not.**For full credit, your code:**- must not modify the tree.
- may use any required functions from java.lang.Math.
- must not be more than 15 lines of code and may be fewer.

`boolean isBalanced(BinaryTreenode<T> node) {`