我想知道以下哪个功能的计算复杂度较低。 背景:我有一个触发信号,该信号触发一个调用我的函数的规则,该规则为某个列表的每个元素添加1。因为该触发信号经常发送,所以我感兴趣的是以下哪些功能。 功能1:
;?lon = list of numbers
(deffunction add-one-to-list-of-numbers (?lon)
(progn$ (?field ?lon)
(bind ?lon (replace$ ?lon ?field-index ?field-index (+ ?field 1)))
)
(return ?lon)
)
功能2:
;?lon = list of numbers
;?cnt = counter
(deffunction add-one-to-list-of-numbers-alt (?lon)
(loop-for-count (?cnt (length ?lon))
(bind ?lon (replace$ ?lon ?cnt ?cnt (+(nth$ ?cnt ?lon) 1)))
)
(return ?lon)
)
答案 0 :(得分:1)
我建议根据经验进行测试:
<section class="falling-person">
<div class="bubbles-one"><img src="./assets/images/bubble_01edit.png" alt="" class="img-fluid"></div>
<div class="container">
<dov class="row">
<div class="col-12">
<div class="image-holder">
<ul class="falling-scene">
<li class="layer" id="bubble_splash-layer"><img src="http://www.sharksharkshark.net/testing/assets/images/bubble_splash.png" alt="" class="mx-auto d-block img-fluid splash rellax"></li>
<li class="layer" id="spotlight-layer"><img src="http://www.sharksharkshark.net/testing/assets/images/spotlight.png" alt="" class="mx-auto d-block img-fluid spotlight rellax"></li>
<li class="layer" id="man-layer"> <img src="http://www.sharksharkshark.net/testing/assets/images/man.png" alt="" class="img-fluid man rellax"></li>
</ul>
</div>
</div>
</dov>
</div>