Machine-translated by Google. Questions are authored in English.
Top

Discussion

Assertion (A): Dynamic programming can find the least cost tiling of an expression tree.
Reason (R): The optimal cost of a node depends only on the optimal costs of its subtrees.

  • A.A is true but R is false
  • B.A is false but R is true
  • C.Both A and R are true, and R is the correct explanation of A
  • D.Both A and R are true, but R is not the correct explanation of A

Answer: C

Both are true and the reason gives the mechanism, and the property is exactly what dynamic programming requires. Optimality no longer follows once the intermediate form is a graph rather than a tree, since a shared node has more than one parent.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.