pav*_*lag 3 lisp performance complexity-theory common-lisp time-complexity
我认为list-length是一个O(n)复杂度操作,因为似乎没有其他方法可以找到它,但是要遍历所有列表的元素.
;; iterates through list's elements
;; and returns 6, right?
(list-length '(1 2 3 4 5 6))
Run Code Online (Sandbox Code Playgroud)
不过,我想确定一下,因为它对我的作品至关重要.它是否正确?
| 归档时间: |
|
| 查看次数: |
1086 次 |
| 最近记录: |