Homework Help Question & Answers

Dear, please rewrite the codes below in a different format in C++. Thank you unsigned char* ptr = load-page( page);...


Dear, please rewrite the codes below in a different format in C++. Thank you unsigned char* ptr = load-page( page); page inde
Dear, please rewrite the codes below in a different format in C++. Thank you unsigned char* ptr = load-page( page); page index = find-free-space(); if NOT FOUND page index) int pop-page = history->RemoveTail(); page index = is-page-loaded(pop-page); free(physical memory[page_index]); history->AddToHead(page); page-table[page index] = page; physical_memory[page index]-ptr
0 0
Next > < Previous
ReportAnswer #1

The code will be


unsigned char* p;
p=load_page(page);
index=find_free_space();
if(index!=NOT_FOUND)
{
history->AddToHead(page);
page_table[index]=page;
physical_memory[index]=p;
}
else{
int page1=history->RemoveTail();
index=is_page_loaded(page1);
free(physical_memory[index]);
history->AddToHead(page);
page_table[index]=page;
physical_memory[index]=p;
}

Do give a thumbs up and in case there are doubts leave a comment.

Add Homework Help Answer
Add Answer of:
Dear, please rewrite the codes below in a different format in C++. Thank you unsigned char* ptr = load-page( page);...
Your Answer: Your Name: What's your source?
Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
More Homework Help Questions Additional questions in this topic.
Need Online Homework Help?
Ask a Question
Get FREE EXPERT Answers
WITHIN MINUTES
Related Questions