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

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 129', 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 compute_hash function from superm Figure codelist This may look mysterious but it s actually pretty simple. After clearing the hash code we are going to calculate it enters a loop that first shifts the old hash code one decimal place to the left end around then adds the low four bits of the next character from the key to the result. When it finishes this loop it returns to the caller in this case compute_cache_hash. How did I come up with this algorithm Making a Hash of Things Well as you will recall from our example of looking up a telephone number the idea of a hash code is to make the most of variations in the input data so that there will be a wide distribution of starting places for the records in the file. If all the input values produced the same hash code we would end up with a linear search again which would be terribly slow. In this case our key is a UPC code which is composed of decimal digits. If each of those digits contributes equally to the hash code we should be able to produce a fairly even distribution of hash codes which are the starting points for searching through the file for each record. As we noted earlier this is one of the main drawbacks of hashing the difficulty of coming up with a good hashing algorithm. After analyzing the nature of the data you may have to try a few different algorithms with some test data until you get a good distribution of hash codes. However the effort is usually worthwhile since you can often achieve an average of slightly over one disk access per lookup assuming that several records fit in one physical disk record . Meanwhile back at compute_cache_hash we convert the result of compute_hash which is an unsigned value into an index into the cache. This is then returned to lookup_record_and_number as the starting cache index. As mentioned above we are using an eight-way associative cache in which each key can be stored in any of eight entries in a cache line. This means that we

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.