所以我有
(def a (vec (range 1000000)))
(def b (vec (range 100000)))
并取两个向量的其余部分
(time (dorun (subvec b 1 100000)))
=>"Elapsed time: 3.585556 msecs"
(time (dorun (subvec a 1 1000000)))
=>"Elapsed time: 43.088316 msecs"
文档说这个操作需要 O(1)。我错过了什么吗?
所以我有
(def a (vec (range 1000000)))
(def b (vec (range 100000)))
并取两个向量的其余部分
(time (dorun (subvec b 1 100000)))
=>"Elapsed time: 3.585556 msecs"
(time (dorun (subvec a 1 1000000)))
=>"Elapsed time: 43.088316 msecs"
文档说这个操作需要 O(1)。我错过了什么吗?