a little bit confused with the time complexity of the memorization solution


  • 0
    C

    A string with length N has N*(N+1)/2 substring in total, right? When you use memorization, you actually calculate every substring roughly. so I think the time complexity here should be O(N^2), Is that right? By the way, what's the time comlexity of dfs solution without memorization?I s that O(N!)?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.