Computers and Technology
Computers and Technology, 28.06.2021 16:00, lily2019

Sort (in ascending order) the items in a file of size 2x KIB using limited memory. Note that x is a unsigned integer where x > 0.

a. Rules:

i. The file is located in disk (not in memory)
ii. Memory is limited to 2 input buffers and 1 output buffer (4KIB each) Total memory capacity 12 KIB
iii. Assume that the contents of the file are unsigned integers separated by a comma delimiter. (i. e 3,1,3,100,99...)
iv. The unsigned integers are not sorted
v. The file can contain duplicated integers
vi. When in a file, a digit from an integer is 1 byte (datatype is char). When in a buffer, an integer is 4 bytes (data type is integer).
vii. Pass number 0 can only use the output buffer. All the remaining passes can use all the available buffers in memory
viii. All the buffers in memory support ±4 bytes of additional memory allocation.
ix. The merging process must be done using Merge Sort algorithm.
x. Temporary files, in disk, can only hold a max size of ((#pass + 1) ∗ 4)KIB

b. ) Input and Output

i. Input: A file containing unsorted unsigned integers in the range of 0 and 100 (both inclusive). For example: 100,67,99,99,1,1,3,24,88,96,37,10,1 0,88,100,99,99
ii. Output: A file containing the sorted integers from the input file. For example: 1,1,3,10,10,24,37,67,88,88,96,99,99 ,99,99,100,100

Required:
Describe the algorithm to solve the problem for a given file of size 2^5 and 2^x (any given x).

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:10, MadiAbbott798
How does access indicates that a filter has been applied to a specific column
Answers: 1
image
Computers and Technology, 22.06.2019 12:10, tragesserj
1. declare a constant named cents_per_pound and initialize with 25. 2. get the shipping weight from user input storing the weight into shipweightpounds. 3. using flat_fee_cents and cents_per_pound constants, assign shipcostcents with the cost of shipping a package weighing shipweightpounds.
Answers: 2
image
Computers and Technology, 22.06.2019 12:30, Machuco127
Some of the first computer games were created in the early 1970s by college students experimenting after hours to see what the were capable of doing.
Answers: 3
image
Computers and Technology, 23.06.2019 06:00, ashleyd198308
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
Do you know the correct answer?
Sort (in ascending order) the items in a file of size 2x KIB using limited memory. Note that x is a...

Questions in other subjects: