如何区分空间复杂度O(1)到O(n) [英] How to make difference between space complexity O(1) to O(n)

查看:433
本文介绍了如何区分空间复杂度O(1)到O(n)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我很难分辨哪个空间复杂度是正确的。

请让我明白:)

Hey guys i''m having trouble to tell which space complexity is the right.
pls make me understand :)

推荐答案

当然:

http://en.wikipedia.org/wiki/Space_complexity [< a href =http://en.wikipedia.org/wiki/Space_complexitytarget =_ blanktitle =New Window> ^ ],

http://en.wikipedia.org/wiki/Space_complexity_theory [ ^ ],

http ://en.wikipedia.org/wiki/Big_O_notation [ ^ ]。



我认为上一篇文章很清楚。 O(1)意味着空间复杂度渐近不依赖于输入数据的大小; O(N)表示它与线性成比例。



-SA
Sure:
http://en.wikipedia.org/wiki/Space_complexity[^],
http://en.wikipedia.org/wiki/Space_complexity_theory[^],
http://en.wikipedia.org/wiki/Big_O_notation[^].

I think last article is quite clear. O(1) means that space complexity asymptotically does not depends on the size of input data; O(N) means it''s linearly proportional.

—SA


这篇关于如何区分空间复杂度O(1)到O(n)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆