tailieunhanh - HandBooks Professional Java-C-Scrip-SQL part 127
Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 127', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | -------- -------- -------- -------- 4 I 0000000 I 0000000 I 0000000 I 0000000 -------- -------- -------- -------- 5 I 0000000 I 0000000 I 0000000 I 0000000 -------- -------- -------- -------- 6 I 0000000 I 0000000 I 0000000 I 0000000 -------- -------- -------- -------- 7 I 0000000 I 0000000 I 0000000 I 0000000 -------- -------- -------- -------- 8 I 0000000 I 0000000 I 0000000 I 0000000 -------- -------- -------- -------- 9 I 0000000 I 0000000 I 0000000 I 0000000 -------- -------- -------- -------- So the answer is that we can t stop before the beginning of the next subfile because the record we are looking for might have overflowed to the next subfile as 1234321 just did. Where can we stop Well we know that the record we are looking for is somewhere between the beginning of the subfile it belongs in and the next invalid record since we go to the next subfile only when the one we are trying to use is filled up. Therefore if we get to an invalid record we know that the record could not be stored later in the file since the current subfile is not filled up yet this means that we can stop looking when we get to the first invalid record. Some Drawbacks of Hashing This points out one of the drawbacks of standard disk-based hashing SDBH . We cannot delete a record from the file simply by setting the invalid flag in that record if we did any record which overflowed past the one we deleted would become inaccessible as we would stop looking when we got to the invalid record. For this reason invalid records must be only those that have never been used and therefore can serve as end-of-subfile markers. While we re on the topic of drawbacks of SDBH we ought to note that as the file gets filled up the maximum length of a search increases especially an unsuccessful search. That is because adding a record to the end of a subfile that has only one invalid entry left results in merging that subfile and the next one so that searches for entries in the first subfile have to continue
đang nạp các trang xem trước