File Structure pre-finals

1. Sorting and Searching

Choose the CORRECT answer:

A. One advantage of KEYSORTING is that it requires less memory than a regular internal sorting of a file.

B. INTERNAL SORTING of a file refers to any sorting method that takes place in main memory, including the situation in which the file does not completely it into main memory.

C. SEQUENTIAL SEARCH on a file takes less time than BINARY SEARCH on the file, since reading a file sequentially is faster than seeking through the file.

D. A BINARY SEARCH on a file of n records (for arbitrary n) takes in the worst case n disk accesses.

E. INTERNAL SORTING of a file of n records (for arbitrary n) requires at least n x log n accesses to secondary storage.


2. Which of the following phrases is WRONG?

A. Wasted space within a record is called INTERNAL FRAGMENTATION.

B. Record deletion in variable-length record files may cause EXTERNAL FRAGMENTATION.

C. STORAGE COMPACTION can be used to combat external fragmentation.

D. FRAGMENTATION can be dealt with dynamically by reclaiming deleted space when records are added.

E. EXTERNAL FRAGMENTATION is usually WORSE when deleted records are of fixed-length as opposed to variable-length.


3. Which of the following statements is CORRECT:

A. Compression is seldom worthwhile since the time it takes to run a compression program does not justify the amount of space saved by the compression.

B. One must consider the usual time/space trade-off when using data compression: while data compression allows the use of less disk storage, it increases the time necessary to transmit the file over a data channel such as the internet.

C. RUN-LENGTH ENCODING, the compression method that consists of summarizing repeated contiguous values, is more effective for text compression than for image compression.

D. Lempel-Ziv and Huffman Encoding are space efficient compression techniques routinely used in UNIX systems.

E. Huffman and Lempel-Ziv encoding are both able to reach the same expected number of bits needed to encode each symbol, but Lempel-Ziv encoding also requires knowledge of the symbols' probabilities.


4. Consider the following string

ababcaabcabc

If we assume that 8 bits are normally needed to encode each character, then how many bits does Lempel-Ziv encoding allow us to save with respect to the original message?

A. 0 bits

B. between 1 and 20 bits (included)

C. between 21 and 40 bits (included)

D. between 41 and 60 bits (included)

E. more than 60 bits


5. Which of the following statements is CORRECT:

A. There exist many different types of buffers including system buffers which handle I/O and program buffers which handle a program's data.

B. When using a Buffer Pooling strategy, it is advisable to use the MOST RECENTLY USED strategy to select a buffer for usage from the buffer pool. In this way, we can be sure that the buffers that have been used most recently do not remain in memory for too long.

C. DOUBLE BUFFERING, i.e. using 2 buffers, will slow the I/O operation down when a program needs to both read from the disk and write to the disk during its execution.

D. Buffering will make I/O operations more efficient only when I/O-CPU overlapping is NOT permitted.

E. When a program crashes, the content of the buffers that the program was using before the crash is always saved onto secondary storage.


6. Select the statement that is FALSE:

A. The I/O processor runs independently of the CPU, allowing for I/O processes and internal computing to overlap.

B. The disk controller is responsible for controlling the operation of the disk drive.

C. The following are tasks attributed to the operating system/file manager: keeping a file allocation table, managing the use of buffers, deciding which cluster on disk will be allocated to a file.

D. If at a given time the disk drive is available for writing, the system I/O buffer will not be used, since bytes can be written directly to the disk.

E. A cluster consists of one or more contiguous sectors. The use of large clusters can improve sequential access times, since longer spans of data can be read without seeking.


7. Select the answer that describes a STRENGTH attributed to CD-ROMs:

A. Fast seek performance.

B. Fast transfer rate.

C. Large storage capacity.

D. CLV (constant linear velocity) organization.

E. Read/Write capability.


8. Select the statement that is FALSE:

A. A primary key is a key that is used to identify uniquely a record.

B. A key may be the combination of one or more fields in a record.

C. Beginning a field with a length indicator or separating fields with delimiters are methods used in variable-length fields.

D. Fixed-length records may contain variable-length fields.

E. If a file contains variable-length records, the RRN (relative record number) can be used to calculate the byte offset of a record.


9. To protect the data on a 3½“ floppy, you should write-protect the diskette by _____.

A. sliding the slide to open the hole

B. sliding the slide to close the hole

C. using tape to cover the notch

D. swipe the disk with a magnet so the data can't be read


10. Access time (the time it takes to access data) depends on _____.

A. rotational delay

B. seek time

C. settling time

D. transfer rate

E. all of the above

F. none of the above

Post a Comment

0 Comments