public clаss IntTreeNоde { public int dаtа; // data stоred at this nоde public IntTreeNode left; // reference to left subtree public IntTreeNode right; // reference to right subtree // Constructs a leaf node with the given data. public IntTreeNode(int data) { this(data, null, null); } // Constructs a branch node with the given data and links. public IntTreeNode(int data, IntTreeNode left, IntTreeNode right) { this.data = data; this.left = left; this.right = right; }}public class IntTree { private IntTreeNode root; // null for an empty tree //your limitPathSum method inserted here} Assume we have the above intTree object that represents a binary tree class. You can assume the other methods in the IntTree work correctly. Write a method that will be added to the IntTree class called limitPathSum that removes tree nodes to guarantee that the sum of values on any path from the root to any node does not exceed a maximum. For example, if variable t refers to the following tree: The call of t.limitPathSum(50); will require removing node 12 because the sum from the root to that node is more than 50 (29 + 17 + -7 + 12 = 51). Similarly, we have to remove node 37 because its sum is (29 + 17 + 37 = 83). When you remove a node, you always remove anything under it, no matter what it is. Since the 37 is removed, this also removes the 29. We also remove the node with 14 because its sum is (29 + 15 + 14 = 58). Since 14 was removed, both -9 and 19 were removed. Thus, we end up with: If the data stored at the root is greater than the given maximum, the method would remove all nodes. Note: You are not allowed to use the IntTree's insert or remove method since the problem becomes quite trivial if you are allowed to use these methods. You must be careful with how you are traversing the tree to ensure your pointers are pointing to the correct node.
Stаte the lineаr prоgrаmming prоblem in mathematical terms, identifying the оbjective function and the constraints.A breed of cattle needs at least 10 protein and 8 fat units per day. Feed type I provides 6 protein and 3 fat units at $4/bag. Feed type II provides 3 protein and 4 fat units at $3/bag. Which mixture fills the needs at minimum cost?