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

对于有多个参数的函数时间及空间复杂度怎么表示 #1295

Closed
LRoInT opened this issue Apr 20, 2024 · 1 comment
Closed

对于有多个参数的函数时间及空间复杂度怎么表示 #1295

LRoInT opened this issue Apr 20, 2024 · 1 comment

Comments

@LRoInT
Copy link

LRoInT commented Apr 20, 2024

有时函数会出现有多个参数的情况,若这两个参数都会影响时间及空间复杂度时该怎么表示

@krahets
Copy link
Owner

krahets commented May 15, 2024

和一个参数的表示方法一样,将每个独立参数都计入考虑就行了,例如双层循环分别为 m 次和 n 次,那么时间复杂度为 O(mn)

@krahets krahets closed this as completed May 15, 2024
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

2 participants