Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ link list program(no vector) You are to write a program that will input a stream of accessed variables simulating the variables accessed in a

c++ link list program(no vector)

You are to write a program that will input a stream of accessed variables simulating the variables accessed in a running program. The buffer will be implemented as a link list. Any variable accessed must first be determined if the variable is in the buffer. If so, move the variable to front of list to represent most recently used. The variables at the end of the list are the less recently used. Any variable not found in the list will be placed/added at the front of the list. At all times the buffer cannot exceed its limits.

You are to simulate different buffer sizes to see if the larger buffer size really saves much on the true memory access. So have your program test with buffer sizes of 4, 5, 6, 7, and 8, the max number of variables in the buffer. Run your program, reading through the data 5 times, one for each buffer size to test. Keep up with the number of times you have to access true memory (ie the number of times a variable is added to the buffer). Be sure not to exceed the buffer size with the number of variables in the list. Print out the buffer size and the number of memory accesses required to simulate this intermediate storage. On end-of-file for each buffer size tested, print out the current variables in the buffer at the time all variables have been read/input from the file.

The Data Structure we are implementing is called a self-organizing list in which we have a list and on each access to a node in the list, the list is reorganized as new variables are encountered.

INPUT: Your input file for the variable stream is LinkL Var Stream.txt.

OUTPUT: Each Buffer size, number of memory accesses and the last list of variables remaining in the buffer.

LinkLVarStream.txt

tom sue joe finney tobee total joe joe tom total goo tobee tobee total sid mikey tom tobee blue blue blue sue goo blue blue miney tobee sumup moreso sid sid mikey mikey lesso maybso goo sidtom tom tom sue blue goo sumup tobee finney finney tobee joe joe tom total goo tobee tobee total sid mikey tom tobee blue blue blue sue mikey joe where blue tom finney blue goo joe mikey where finney joe mikey goo blue blue miney tobee cooly sumup moreso sid sid mikey mikey lesso maybso goo sid tom mikey lisso maybso goo goo total where about about tom blue sid finney jojo tobee joe joe tom total goo tobee tobee total sid mikey tom tobee blue blue blue sue goo blue blue miney tobee sumup lisso maybso goo goo sumup total moreso sid mikey mikey cooly lisso goo tobee tobee total sid mikey tom tobee blue blue blue sue so so so total tom lesso maybso goo ghost sid tom blue sid where joe sue joe sue tom sue where sid tom mikey lisso jo sumup jo jo maybso goo goo sumup total sumup lisso maybso goo goo sumup total cooly about tom blue sid finney tobee ghost ghost cooly joe joe tom total goo blue bmoreso sid sid mikeylue miney mikey tom tobee blue blue blue sue so so so total tom lesso goo tobee tom blue sid sid goo maybso goo sid tom blue sid where joe ghost sue joe sue tom sue mikey total conditions maybso goo goo sumup total blue tom finney goo sid blue blur blue joe sumup total miney total categories advanced estate finney goo sid blue blur box west team estate team estate box estate sales look windows photos english estate box estate box left conditions select windows photos sid blue blur blue joe sumup team estate box windows photos team estate photos conditions select windows photos windows photos team estate photos windows photos west left conditions west photos team estate west categories advanced estate box categories advanced west estate box select photos team select windows photos left conditions team estate left conditions west west west west select west windows select windows photos team west left conditions photos team estate box windows select left conditions windows left conditions photos team windows photos team estate box windows

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How does EVA differ from residual income?

Answered: 1 week ago

Question

a. Describe the encounter. What made it intercultural?

Answered: 1 week ago