Practice free →
HomeGATE CSEcomputerscienceAlgorithms › The standard DP solution for matrix-chain multip…

The standard DP solution for matrix-chain multiplication runs in

AO(n²)
BO(n³)
CO(2^n)
DO(n log n)
Answer & Solution
Correct answer: B. O(n³)
The DP fills an n × n table where each cell tries O(n) split points. Total time is O(n²) cells × O(n) per cell = O(n³). The other options describe different running times: O(n²) is the cell count (not the per-cell work), O(2^n) is exponential (avoided by DP), O(n log n) is too low for this problem.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions