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

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 128', 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ả | extra space to prevent the hashing from getting too slow means that the file would end up taking up about 437 Kbytes. For this application disk storage space would not be a problem however the techniques we will use to reduce the file size are useful in many other applications as well. Also searching a smaller file is likely to be faster because the heads have to move a shorter distance on the average to get to the record where we are going to start our search. If you look back at Figure initstruct you will notice that the upc field is ten characters long. Using the ASCII code for each digit which is the usual representation for character data takes one byte per digit or 10 bytes in all. I mentioned above that we would be using a limited character set to reduce the size of the records. UPC codes are limited to the digits 0 through 9 if we pack two digits into one byte by using four bits to represent each digit we can cut that down to five bytes for each UPC value stored. Luckily this is quite simple as you will see when we discuss the BCD binary-coded decimal conversion code below. The other data compression method we will employ is to convert the item descriptions from strings of ASCII characters limited to the sets 0-9 A-Z and the special characters comma period minus and space to Radix40 representation mentioned in Chapter . The main difference between Radix4 0 conversions and those for BCD is that in the former case we need to represent 40 different characters rather than just the 10 digits and therefore the packing of data must be done in a slightly more complicated way than just using four bits per character. The Code Now that we have covered the optimizations that we will use in our price lookup system it s time to go through the code that implements these algorithms. This specific implementation is set up to handle a maximum of FILE_CAPACITY items defined in superm. h Figure .5 Each of these items as defined in the ItemRecord .

Đã 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.