阿摩線上測驗 登入

申論題資訊

試卷: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

申論題內容

(d) What is the lowest computational complexity one can possibly achieve for this problem? (You can get the score as long as you give the right order. After the examination, it could be a fun exercise if you try to achieve this lowest computation complexity by modifying the program only slightly. The run time will make a big difference when you jump for 100 steps) (5%)