Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0337.打家劫舍III 方法2:记忆化递推 时间复杂度的疑问 #2403

Open
Pika-Lee opened this issue Jan 11, 2024 · 0 comments
Open

Comments

@Pika-Lee
Copy link
Contributor

原文如下:
时间复杂度:O(n)
空间复杂度:O(log n),算上递推系统栈的空间

//感觉这里的空间复杂度似乎没有算上unordered_map的空间开销?遍历整个二叉树的时候,会将所有的节点存入unordered_map,所以空间复杂度应该为O(n)?

原文链接:https://programmercarl.com/0337.%E6%89%93%E5%AE%B6%E5%8A%AB%E8%88%8DIII.html#%E8%AE%B0%E5%BF%86%E5%8C%96%E9%80%92%E6%8E%A8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant