Question textConsider the following algorithm. Assume the input is a positive integer. [table] 1 2 3 4 5678 | function FUNC(n) if n < 4 then return 3 * n else count = 0 for i = 1 to n do count = count + i return count + FUNC(n/4) * FUNC(n/4) [/table] The recurrence relation for the running time of this function can be expressed as , where and are expressions and and are their conditions under which they apply. Fill in the correct general case and base case to replace X/X' and Y/Y' below (no need to solve the relation, or give its time complexity). You may assume that a, b, c, d, e and f are constants of your choosing should you need them for the recurrence. Do not forget to include the condition on where each case would be applicable in the box on the right. General case (X if X'): Answer 1 Question 1[input] if Answer 2 Question 1[input] Base case (Y if Y'): Answer 3 Question 1[input] if Answer 4 Question 1[input]多项填空题

题目图片

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!