Algorithms.
an empty queue, Q. Create a dummy node of decision tree and enqueue it to Q. Profit and weight of dummy node are 0. Do while (Q is not empty). Extract an item from Q. Let the item be x. Compute profit of next level node. If the profit is more than max, then update max. (Profit from root to this