[問題] 時間複雜度分析

看板Python作者 (.)時間7年前 (2018/07/10 16:50), 編輯推噓3(301)
留言4則, 2人參與, 7年前最新討論串1/1
https://leetcode.com/problems/different-ways-to-add-parentheses/description/ https://paste.ubuntu.com/p/j8vFpgbd44/ 暴力解寫出來,但是不會分析這個暴力解的時間複雜度 請高手幫忙指點 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 172.89.32.145 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1531212610.A.0BF.html

07/10 17:30, 7年前 , 1F
小弟估算是四次方或五次
07/10 17:30, 1F

07/10 17:39, 7年前 , 2F
估計是五次吧 一個n loop 裡面牽1+到n的n^2=n^4 tota
07/10 17:39, 2F

07/10 17:39, 7年前 , 3F
l n^5
07/10 17:39, 3F

07/11 10:03, 7年前 , 4F
n=1,2,3,4,5,6...f(n)=1,2,6,18,54,162...t(n)=3^n
07/11 10:03, 4F
文章代碼(AID): #1RH7D22_ (Python)
文章代碼(AID): #1RH7D22_ (Python)