Skip to content
StackDecode
Dynamic programmingExplained

Maximum Path Sum

Best path in a tree or triangle by combining best child paths.

Time

O(n)

Extra space

O(h)

Use it for

Path optimisation.

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.