Trivia ForgePlay free →

What is the time complexity of the standard dynamic programming algorithm for the Matrix Chain Multiplication problem with n matrices?

Show answer

O(n^3)

The algorithm computes the optimal costs for all possible sub-chains of matrices. Since there are O(n^2) such sub-chains and each requires O(n) time to compute the optimal split point, the total complexity is O(n^3).

Would you remember this in 6 months?

Trivia Forge uses spaced repetition so facts stick. Free, no signup needed.

Turn on Algorithms practice →

More Algorithms trivia

See all 83 →