Skip to content
StackDecode
Dynamic programmingExplained

Matrix Chain Multiplication

Choose the bracketing that minimises scalar multiplications.

Time

O(n³)

Extra space

O(n²)

Use it for

Ordering associative operations.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.