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.

Know the 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.
Similar Homework Help Questions
  • Please answer this problem in C++, Thank you! Read and study the sample program: "hashing with chaining using singly...

    Please answer this problem in C++, Thank you! Read and study the sample program: "hashing with chaining using singly linked lists", as well as "hashing with chaining using doubly linked lists". Notice this program is complete except it doesn't include the remove function. Write the remove function and test it with the rest of the program including the given main program. Upload your C++ source file. ---Here is the referenced program: "hashing with chaining using singly linked lists". Below this...

  • Please answer problem #5 thank you str.c #include "str.h" #include <stdio.h> int str_len(...

    Please answer problem #5 thank you str.c #include "str.h" #include <stdio.h> int str_len(char *s) {    /* this is here so code compiles */ return 0; } /* array version */ /* concantenate t to the end of s; s must be big enough */ void str_cat(char s[], char t[]) {    int i, j;    i = j = 0;    while (s[i] != '\0')    /* find end of s */        i++;    while ((s[i++] = t[j++]) != '\0') /* copy t */        ;...

  • In C++: Please help me correct this code .... All parts with (FIX ME) #include <algorithm> #include <climits&gt...

    In C++: Please help me correct this code .... All parts with (FIX ME) #include <algorithm> #include <climits> #include <iostream> #include <string> // atoi #include <time.h> #include "CSVparser.hpp" using namespace std; //============================================================================ // Global definitions visible to all methods and classes //============================================================================ const unsigned int DEFAULT_SIZE = 179; // forward declarations double strToDouble(string str, char ch); // define a structure to hold bid information struct Bid { string bidId; // unique identifier string title; string fund; double amount; Bid() {...

  • Programming in C

    I want to write a function that reads words from a file and order them with alphabetical order. Then the user by inserting i can insert new word by s cansearch by d can delete... Also I should generate a binary search for determinnig the location of the word I should use dynamic array... Dynamic DictionaryArray. I just need the solution to lab3. Background:Lab #3 is a re-make of Lab #2. The two are identical in appearance, interaction and output....

  • Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin...

    Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin at the University of Washington, Seattle, who originally wrote this assignment (for their CSE 142, in Java) This program focuses on classes and objects. Turn in two files named Birthday.cs and Date.cs. You will also need the support file Date.dll; it is contained in the starter project for this assignment. The assignment has two parts: a client program that uses Date objects, and a...

Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
Share Your Knowledge

Post an Article
Post an Answer
Post a Question with Answer

Self-promotion: Authors have the chance of a link back to their own personal blogs or social media profile pages.