- 最后登录
- 2010-12-29
- 在线时间
- 160 小时
- 寄托币
- 3052
- 声望
- 1
- 注册时间
- 2005-5-6
- 阅读权限
- 30
- 帖子
- 7
- 精华
- 2
- 积分
- 2847
- UID
- 209096
 
- 声望
- 1
- 寄托币
- 3052
- 注册时间
- 2005-5-6
- 精华
- 2
- 帖子
- 7
|
发表于 2005-11-10 21:13:04
|显示全部楼层
下面这几道题对着答案也不明白,有没有知道的人给我解释一下,多谢啦~~~
1、Hash tables can contribute to an efficient average-case solution for all of the problems described below EXCEPT:
(A) Counting distinct values: Given a set of n keys, determine the number of distinct key values.
(B) Dynamic dictionary: Support the operations of insert, delete, and search in a dictionary
(C) Range search: Given values a and b, find all the records whose key value is in the range [a,b].
(D) Symbol table lookup: Given a program identifier, find its type and address.
(E) Finding intersections: Given two sets of keys, find all key values in common to both sets.
Answer: C
请问E答案说的问题怎么通过hash table解决阿?
2、A certain pipelined RISC machine has 8 general-purpose registers R0, R1, . . . , R7 and supports the following operations.
ADD Rs1, Rs2, Rd Add Rs1 to Rs2 and put the sum in Rd
MUL Rs1, Rs2, Rd Multiply Rs1 by Rs2 and put the product in Rd
An operation normally takes one cycle; however, an operation takes two cycles if it produces a result required by the immediately following operation in an operation sequence. Consider the expression AB+ABC+BC, where variables A, B, C are located in registers R0, R1, R2. If the contents of these three registers must not be modified, what is the minimum number of clock cycles required for an operation sequence that computes the value of AB+ABC+BC?
(A) 5 (B) 6 (C) 7 (D) 8 (E) 9
Answer: B
难道执行过程是下面这样的?自己不确定
MUL R0, R1, R3 // 计算AB,1 clock cycle
MUL R1, R2, R4 // 计算BC,1 clock cycle
MUL R3, R2, R5 // 计算ABC,1 clock cycle
ADD R3, R4, R6 // 计算AB + BC, 2 clock cycles
ADD R6, R5, R7 // 计算AB + BC + ABC, 1 clock cycles
3. In systems with support for automatic memory management, a garbage collector typically has the responsibility for reclaiming allocated memory objects whose contents cannot affect any future legal computation. Such objects are identified by determining that they cannot be reached from a root set. Which of the following is NOT part of the root set in a typical garbage collector?
(A) Actual parameters of the active procedures
(B) Dynamically allocated objects on the heap
(C) Global variables of the program
(D) Local variables on the call stack
(E) Values in machine registers
Answer: B
root set是什么意思?难道寄存器的值也算在内?
4. Let M be a single-tape, deterministic Turing machine with tape alphabet {blank, 0, 1}, and let C denote the (possibly infinite) computation of M starting with a blank tape. The input to each problem below is M, together with a positive integer n. Which of the following problems is (are) decidable?
I. The computation C lasts for at least n steps.
II. The computation C lasts for at least n steps, and M prints a 1 at some point after the nth step.
III. M scans at least n distinct tape squares during the computation C.
(A) None
(B) III only
(C) I and II only
(D) I and III only
(E) I, II, and III
Answer: D
5. Assume that a debugger places a breakpoint at a load instruction at virtual address 0x77E81234 (hexadecimal notation) in a debugged process P. If the text segment of P begins at 0x77E80000 in P's virtual address space and if the debugger has mapped this same text segment at 0x01000000 in its virtual address space, which of the following is the virtual address used by the debugger in its WRITE operation, along with a description of how the debugger has mapped the virtual memory page containing this address?
(A) 0x01001234; page mapped with READ/WRITE access
(B) 0x01001234; page mapped with COPY-ON-WRITE access
(C) 0x76E81234; page mapped with READ/WRITE access
(D) 0x76E81234; page mapped with COPY-ON-WRITE access
(E) 0x77E81234; page mapped with READ/WRITE access
Answer: A
READ/WRITE access 和 COPY-ON-WRITE access有什么区别? |
|