For each scenario described below, discuss the algorithm and the data structure you would use to count the occurrences of characters in a file given the following constraints. Present a discussion on the algorithm only, do not present source code. The program must utilize the minimum amount of memory throughout the duration of the program. The program must minimize the power consumption used by the program (limit the CPU load). The program will be required to load the frequencies once, but the program will access the individual frequencies often during the execution of the program. Provide a design that conserves memory utilization while providing the fastest access to the data. The program will need to calculate the frequencies, but the program must preserve the order in which the characters were encountered while processing the file. That is, the order of the elements in the data structure(s) must be the order in which they were first encountered in the file. The program must conserve both CPU and memory with memory being the most important. The program will not be reading a file, but a network stream for input. Characters will be sent via a socket program to the counting program. The program must continuously track the frequencies of all characters encountered while the program is running. A key constraint is that the list must always be sorted in frequency order so that the smallest frequency is the first element and the largest frequency is the last element. The access speed of the largest and smallest element is the most important constraint followed by memory consumption.
For each scenario described below, discuss the algorithm and the data structure you would use to count the occurrences of characters in a file given the following constraints. Present a discussion on the algorithm only, do not present source code. The program must utilize the minimum amount of memory throughout the duration of the program. The program must minimize the power consumption used by the program (limit the CPU load). The program will be required to load the frequencies once, but the program will access the individual frequencies often during the execution of the program. Provide a design that conserves memory utilization while providing the fastest access to the data. The program will need to calculate the frequencies, but the program must preserve the order in which the characters were encountered while processing the file. That is, the order of the elements in the data structure(s) must be the order in which they were first encountered in the file. The program must conserve both CPU and memory with memory being the most important. The program will not be reading a file, but a network stream for input. Characters will be sent via a socket program to the counting program. The program must continuously track the frequencies of all characters encountered while the program is running. A key constraint is that the list must always be sorted in frequency order so that the smallest frequency is the first element and the largest frequency is the last element. The access speed of the largest and smallest element is the most important constraint followed by memory consumption.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
- For each scenario described below, discuss the
algorithm and the data structure you would use to count the occurrences of characters in a file given the following constraints. Present a discussion on the algorithm only, do not present source code.
- The
program must utilize the minimum amount of memory throughout the duration of the program. - The program must minimize the power consumption used by the program (limit the CPU load).
- The program will be required to load the frequencies once, but the program will access the individual frequencies often during the execution of the program. Provide a design that conserves memory utilization while providing the fastest access to the data.
- The program will need to calculate the frequencies, but the program must preserve the order in which the characters were encountered while processing the file. That is, the order of the elements in the data structure(s) must be the order in which they were first encountered in the file. The program must conserve both CPU and memory with memory being the most important.
- The program will not be reading a file, but a network stream for input. Characters will be sent via a socket program to the counting program. The program must continuously track the frequencies of all characters encountered while the program is running. A key constraint is that the list must always be sorted in frequency order so that the smallest frequency is the first element and the largest frequency is the last element. The access speed of the largest and smallest element is the most important constraint followed by memory consumption.
- The
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Step 1: Introduction
VIEWStep 2: Scenario 1:Algorithm for Minimum Memory Utilization:
VIEWStep 3: Scenario 2:Algorithm for Minimizing Power Consumption
VIEWStep 4: Scenario3:Algorithm for Fast Access to Frequencies:
VIEWStep 5: Scenario4:Algorithm for Preserving Order and Memory-CPU Conservation: To count frequencies while pre
VIEWSolution
VIEWTrending now
This is a popular solution!
Step by step
Solved in 6 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education