Skip to content
StackDecode
Dynamic programmingExplained

Wildcard Matching

Match with ? (any char) and * (any run) using a table.

Time

O(n · m)

Extra space

O(n · m)

Use it for

Glob patterns.

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.