02E-2 QUIZ
Which situation will the improved blistering order will end prematurely ?
经改进的起泡排序在什么情况下会提前结束?
完成全部n-1趟扫描交换The number of scan conversions completed = The number of scan switching parameters for the actual element exchange + 1
完成的扫描交换趟数 = 实际发生元素交换的扫描交换趟数 + 1 正确The number of scan conversions completed = The number of scan switchings that actually took place for element exchange
完成的扫描交换趟数 = 实际发生元素交换的扫描交换趟数Complete (n - 1) / 2 scan exchange
完成 (n - 1) / 2趟扫描交换
EXPLANATION
Another statement is: No element exchange occurs in a scan switch
另一个说法是:某趟扫描交换中没有发生元素交换
02-D3-3 QUIZ
V={1, 2, 3, 4, 5, 6, 7}, using Fibonacci to find element 1 in V, the element selected as the pivot point mi is:
V={1, 2, 3, 4, 5, 6, 7},在V中用Fibonacci查找元素1,被选取为轴点mi的元素依次是:
Rank mi = lo + fib.get() - 1;
是元素不是索引
实例A
V={2, 3, 5, 7, 11, 13, 17}. How many comparisons V.search(16, 0, 7) need to make?
V={2, 3, 5, 7, 11, 13, 17}。V.search(16, 0, 7)需要进行多少次比较?
lo = 0, hi = 7;
hi在区间外!!
--------------------------------------------
01B-5: 图灵机
Which of the following is NOT a component of a Turing machine? 以下哪项不是图灵机的组成要件?
A tape of finite length 有限长的纸带 A tape of finite length 有限长的纸带 - 正确A finite alphabet 有限的字母表A finite set of states 有限种状态A head for reading and writing 读写头01-E-5: 数组倒置
The base cases of a recursive function are degenerated cases, without which the sequence of recursive function calls would go forever.
01XC-2: FIB():递推方程
The naive way of computing fib(n) recursively leads to a time complexity of
直接用定义以递归的方式计算fib(n)的时间复杂度是: