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

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 132', 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ả | 8 CC CC Now we are ready for the second and final sorting operation. We start by counting the number of occurrences of each character in the first or more significant position. There is one A in this position along with four B s and three C s. Starting with the lowest character value the key that has an A in this position ends up in the first slot of the output. The B s follow starting with the second slot. Remember that the keys are already in order by their second or less significant character because of our previous sort. This is important when we consider the order of keys that have the same first character. For example in Figure the asterisks mark the keys that start with They are in order by their second character since we have just sorted on that character. Therefore when we rearrange the keys by their first character position those that have the same first character will be in order by their second character as well since we always move keys from the input to the output in order of their position in the input. That means that the B records have the same order in the output that they had in the input as you can see in Figure . This may seem like a lot of work to sort a few strings. However the advantage of this method when we have many keys to be sorted is that the processing for each pass is extremely simple requiring only a few machine instructions per byte handled less than 30 on the 80x86 family . More significant character sort Figure 1 BA------ --------AB I I 2 CA - ----------BA I I 3 BA----- --- -------BA I I 4 AB------ ------BB I I 5 CB I I BC ----- I 6 BB I -------- CA -------- 7 BC--- ------------CB 8 CC-----------------CC On the Home Stretch Having finished sorting the keys we have only to retrieve the records we want from the input file in sorted order and write them to the output file. In our example this requires reading the desired records and writing them into an output file. But how do we know which .

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.