16)The cost of a path in a tree is sum of the keys of the nodes participating...
Fantastic news! We've Found the answer you've been seeking!
Question:
16)The cost of a path in a tree is sum of the keys of the nodes participating in that path. Write a function that returns the cost of the most expensive path from the root to a leaf node.
17)Write a function to determine whether a given binary tree is AVL or not.
18)What value does the following function return when called with each of the binary trees in question 3?
int mystery(Nodex) {
if (x == null)
return 0;
else return max(mystery(x.left), mystery(x.right);
}
19)Write a function to determine whether a given binary tree is a heap.
Write a Java program to implement a binary search tree of string values with operations in the above list.
Posted Date: