Question
Here is a project i need to complete using c++ Using a random number generator, you will need to create (4) data sets of 100
Here is a project i need to complete using c++
Using a random number generator, you will need to create (4) data sets of 100 random integers each with values of 0 to 99. Additionally, you will need to create (1) data set of 100 random integers values of 1 to 3. The latter is for priority of the insert priority queue. You may create your data sets once and write them to a file for later reading in or you may create them each run. It must include these functions.
Insert head (for FIFO)
Insert tail (for LIFO)
Insert sorted (largest to tail)
Insert priority (1 at tail then 2, 3)
Create and destroy/delete will be needed. Use pointer passing in arguments.
Build Queues for LIFO, FIFO, Insert sorted, and Insert priority. Initialize the queues with the first 10 numbers of each data set using add functions. Provide functions to add and delete from the queues for remaining 90 nodes. 4 data sets = 4 queues, priority for last queue.
Create 8 registers. 4 inputs and 4 outputs. (hint: same size as your data type)
There will be two runs your main program. Single register and four registers.
Use looping to load/unload the queues from the data sets and to your output file. Each loop is a clock cycle. Count your clock cycle for each of the two functions. Output these counts to your file. Output your input and output data in 10 by 10 matrix to your file.
Run one uses a single register to input to queues and a single register output data.
Run two uses 4 registers to input to queues and 4 registers to output data to files
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started