TAILIEUCHUNG - Thuật toán Algorithms (Phần 17)

Tham khảo tài liệu 'thuật toán algorithms (phần 17)', khoa học tự nhiên, toán học phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | SELECTION AND MERGING 153 Exercises 1. For N 1000 empirically determine the value of k for which the Quicksort-based partitioning procedure be jomes faster than using heaps to find the k th smallest element in a random file. 2. Describe how you would rearrange an array of 4N elements so that the N smallest keys fall in the first N positions the next N keys fall in the next N positions the next N in the next N positions and the N largest in the last N positions. 3. Show the recursive calls made when select is used to find the median of the keys EASYQUESTION. 4. Write a program to rearrange a file so that all the elements with keys equal to the median are in place with smaller elements to the left and larger elements to the right. 5. What method would be best for an that requires selection of the fcth largest element for various arbitrary k a large number of times on the same file 6. True or false the running time of mergesort does not depend on the order of the keys in the input file. Explair. your answer. 7. What is the smallest number of steps mergesort could use to within a constant factor 8. Implement a bottom-up non-recursive mergesort that uses two arrays instead of linked lists. 9. Show the contents of the linked lists passed as arguments to each call when the recursive mergesort is used to sort the keys EASY Q U E S T IO N. 10. Show the contents of the linked at each iteration when the recursive mergesort is used to sort the keys EASY QUE S TIO N. 1 3. External Sorting Many important sorting applications involve processing very large files much too large to fit into the primal y memory of any computer. Methods appropriate for such applications are external methods since they involve a large amount of processing external to the central processing unit as opposed to the internal methods that we ve been studying . There are two major factors which make external algorithms quite different from those we ve seen until now. First the cost of accessing an .

TỪ KHÓA LIÊN QUAN
Đã 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.