阿摩線上測驗 登入

申論題資訊

試卷:110年 - 110-2 國立清華大學期末考試題_電機工程學系:計算機程式設計#112945
科目:程式設計
年份:110年
排序:0

題組內容

8. (20%) Finish a recursive function for solving a jumping Takahashi problem. Assuming that Takahashi is standing at coordinate 0 on a number line. He will now perform 4 jumps forward towards the positive direction. At each jump, he can take a stride of either 2 or 5 steps forward on the line. For example, after the first jump, he can reach coordinates {2, 5}.
63c0b854627d8.jpg

申論題內容

(c) What is the computational complexity of this program? Is it O(n), O(n*log2(n)), O(n2 ), O(2n ), or O(n!), where n denotes the number of jumps taken? (5%)