1. (2 points) for multiple keywords, the kind of file organization is convenient and efficient (B)
A, sequential file B, inverted file C, hash file D, B + Tree index file
Resolution: Answer B.
There are four basic ways to organize files on external memory: sequential organization, index organization, hash organization and chain organization; the corresponding file names are: Sequential files, index files, hash files, and multi-keyword files. The choice of how the file is organized depends on how and how frequently the records are used, the access requirements, the nature of the external memory, and the capacity of the file.
Multi-keyword files: Files that contain multiple secondary keyword indexes are called multi-keyword files.
The main advantage of the inverted table is that when dealing with complex multi-keyword queries, it is possible to complete the query in the inverted table first, and then the logical operation, and then access the records after the results are obtained. This eliminates the need for random access to each record, converting a query of records into an operation of an address set, thus increasing the lookup speed.
4. (2 points) The following statement on the computable nature is correct (D)
A, all questions can eventually be abstracted into a computational model, which can be calculated within a limited time (although it may take a long time): The design of modern computers is based on this theory.
B, there are some problems, we can not give the answer in a limited time: However, all problems can be in a limited time to verify the correctness of their answers.
C, Godel (DEL) The first law indicates that there is no complete and compatible axiom system.
D, the above statements are not correct.
Godel (DEL) The first law: Any form system containing first order predicate logic and elementary number theory, there is a proposition, which can neither be proved nor denied in this system.
5. (2 points) 16 binary numeric C396 and 8 binary value 64474 The XOR result value (10 binary) is (a)
A, 43690 B, 16660 C, 60350 D, 20375
6. (2 points) The following classic question which belongs to the NP problem (A)
A, Turing stop problem B, sort C, 0,1 knapsack problem D, enumerate all subsets of a finite set
7. (2 points) The following letter string exists: Agdccdddgfbbffggdddgggeffddcccdddfgaaa now needs to encode the string Huffman, then the letter F corresponds to the bit value (in binary format) (D)
A, ten B, one C, 101 D,
Statistical results: A:4 b:2 c:5 d:12 e:1 f:6 G:8 and then encoded by Huffman.
9. (2 points) process management if improper design will result in a "deadlock", the typical banker algorithm belongs to (1), and the deprivation of resources belongs to the (2) method.
A, (1) = Deadlock Prevention, (2) = deadlock avoidance
B, (1) = Deadlock Prevention, (2) = deadlock cancellation
C, (1) = Deadlock avoidance, (2) = Deadlock prevention
D, (1) = Deadlock avoidance, (2) = deadlock cancellation
Resolution: Answer B
Deadlock: Refers to two or more than two processes in the execution process, because of the contention for resources caused by a mutual waiting phenomenon, if there is no external force, they will not be able to proceed.
The four necessary conditions for a system to generate a deadlock:
1) Mutually exclusive condition: refers to the process of allocating resources to the exclusive use, that is, for a period of time a resource is occupied by only one process. If there are other processes requesting resources at this time, the requestor can wait until the resource-occupying process is freed.
2) Request and hold condition: means that the process has maintained at least one resource, but a new resource request has been made, and the resource has been occupied by another process, at which time the request process is blocked, but the other resources that you have obtained remain.
3) Non-deprivation conditions: Refers to the process has been obtained resources, before the end of use, can not be deprived, can only be released by themselves when the use is complete.
4) Loop wait condition: Refers to the deadlock, there must be a process-a circular chain of resources, that is, the process set {p0,p1,p2,,pn} P0 is waiting for a P1 to occupy the resources; P1 is waiting for P2 to occupy the resources, ..., PN is waiting for resources that have been consumed by P0.
Banker algorithm: We can think of the operating system as a banker, the operating system manages the resources equivalent to the money bankers manage, the process to the operating system request allocation of resources equivalent to the user to the banker loan. The operating system allocates resources to the process in accordance with the rules established by the banker, and when the process first requests the resources, it tests the maximum resource requirements for the process, and if the existing resources of the system can meet its maximum demand, allocate the resources according to the current amount of requests, or postpone the allocation. When a process continues to request resources in execution, it first tests the number of resources that the process has taken up and the number of resources in the application that exceed the maximum resource requirements for the process. If the allocation of resources is not exceeded, if no more than the existing resources of the test system can meet the maximum amount of resources required by the process, if it can be satisfied with the current amount of applications allocated resources, otherwise also deferred allocation.
10. (2 points) for database indexing, the following statement is correct (D)
A, for some fields to index, can have a small reduction of the relevant database table disk space consumption;
B, for some fields to index, can effectively improve the efficiency of reading and writing related fields;
C, common database management system, usually use hash table to store the index;
D, the existence of the database index, may result in the deletion of related fields less efficient;
Analytical:
A, there is no doubt that building an index requires storage space. Therefore, the first goal of the index is to improve query performance, that is, read performance, but to a certain extent, reduce the performance of writing. To give a counter example, if you can improve the performance, it is not built index is finished. So wrong C, storage index is usually used b* tree. So wrong D, positive solution
Rise Knowledge-1