Grokking Dynamic Programming Patterns for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Top down time and space is O(n^2)?

Shan

Jul 26, 2022

Top down time and space is O(n^2)?

0

0

Comments
Comments
S
Shan 3 years ago

Rather O(m*n)

Design Gurus
Design Gurus3 years ago

The time and space complexity of the both bottom up and top down with memoization is O(m*n), where ‘m’ and ‘n’ are the lengths of the string and the pattern respectively.

On this page