subject
Computers and Technology, 07.07.2021 09:20 bry7474

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. All the buffers in memory support ±4 bytes of additional memory allocation. viii. You must use a Divide and Conquer algorithm to solve this problem

ix. 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

Your work starts here

1. Describe the algorithm to solve the problem for a given file of size 25 first, and then describe the algorithm for a given file of size 2x (any given x). Note that x is a unsigned integer where x > 0. You can use tables, diagrams, paragraph description to describe the algorithm. Be as clear as possible, and define clearly each step taken during the process. Credit for this problem will be only given to those students that clearly define a step by step approach to solve this problem.

2. Write the pseudocode that represents your algorithm from problem (1). Note that in this problem, I am asking for the compiled LaTeX pseudocode (PDF format) instead of the LaTeX code that creates this pseudocode

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Which statement is true of web-based social media? a.they allow consumers to interact with and update content. b.they cannot be updated easily, as compared to print media. c.they are expensive to produce and maintain, as compared to print and television. d.they can exist independent of the internet.
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
You know the right answer?
Sort (in ascending order) the items in a file of size 2x KIB using limited memory. Note that x is a...
Questions
question
Chemistry, 02.04.2020 06:47
question
Social Studies, 02.04.2020 06:47
question
Computers and Technology, 02.04.2020 06:47
Questions on the website: 13722362