1. Suppose you have 1000 records on disk. Each record is 2000 bytes, but the key
ID: 3563371 • Letter: 1
Question
1. Suppose you have 1000 records on disk. Each record is 2000 bytes, but the key of each record is only 10 bytes. Explain how index sorting could be used to efficiently output the records in sorted order, and why this is more efficient than sorting all the records in main memory.
2. Consider an algorithm called AbsurdSort. This algorithm will bring all the data to be sorted into a large array in main memory. Then the array will randomly rearranged, and then tested to see if it is sorted. The process repeats until the array is sorted.
Explanation / Answer
AbsurdSort:
The Absurd sort is a internal sort as all the process of sorting takes place with-in the main memory. An Internal Sorting takes place in the main memory of a computer. The internal sorting methods are applied to small collection of data. It means that, the entire collection of data to be sorted in small enough that the sorting can take place within main memory.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.