TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 159

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 159', 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ả | The DynamicHashArray StoreElement function from quantum Figure dynhash. 04 codelist The basic idea is that whenever a particular element that we are trying to store in the hash array is about to exceed the size of a quantum we create a new element in which we ll store the records that wouldn t fit in the previous element. The question of course is how we find the records stored in this new element when they will not be stored in the location in the hash array where we expect to find it. The answer is that we modify the keys of the stored records in a way that we can do again when we re trying to find a particular record. Then we set a chain flag in the original element in the hash array indicating that it has overflowed so that we don t mistakenly tell the user that the record in question is not in the file. Exactly how do we modify the key of the record By appending a character sequence to it that consists of a form feed character followed by an ASCII representation of the number of times that we ve had an overflow in this particular chain. For example if the original key was ABC the first overflow key would be ABC f0 where f represents the form feed character and 0 is the ASCII digit 0. Of course it s also possible that even the second element in which we re storing records with a particular hash key will overflow. However the same algorithm will work in that case as well in this case the second record will have its chain flag set to indicate that the program should continue looking for the record in question if it is not found in the current element and the key will be modified again to make it unique to continue our previous example if the original key was ABC the second overflow key would be ABC f1 where f represents the form feed character and 1 is the ASCII digit 1. How did I choose this particular way of modifying the keys Because it would not limit the users choice of keys in a way that they would object to. Of course I did have to .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.