Question: Hi, I need some help with this Software Engineering question! #include using namespace std; string ltrim(const string &); string rtrim(const string &); // Complete the

Hi, I need some help with this Software Engineering question!

Hi, I need some help with this Software Engineering question! #include using

#include

using namespace std;

string ltrim(const string &);

string rtrim(const string &);

// Complete the recentlyAccessedLog function below.

vector recentlyAccessedLog(vector eids, int buffer_size) {

}

int main()

{

ofstream fout(getenv("OUTPUT_PATH"));

string eids_count_temp;

getline(cin, eids_count_temp);

int eids_count = stoi(ltrim(rtrim(eids_count_temp)));

vector eids(eids_count);

for (int i = 0; i

string eids_item;

getline(cin, eids_item);

eids[i] = eids_item;

}

string buffer_size_temp;

getline(cin, buffer_size_temp);

int buffer_size = stoi(ltrim(rtrim(buffer_size_temp)));

vector res = recentlyAccessedLog(eids, buffer_size);

for (int i = 0; i

fout

if (i != res.size() - 1) {

fout

}

}

fout

fout.close();

return 0;

}

string ltrim(const string &str) {

string s(str);

s.erase(

s.begin(),

find_if(s.begin(), s.end(), not1(ptr_fun(isspace)))

);

return s;

}

string rtrim(const string &str) {

string s(str);

s.erase(

find_if(s.rbegin(), s.rend(), not1(ptr_fun(isspace))).base(),

s.end()

);

return s;

}

You are software engineer who is working on Iaaccess control system. Your task is to develop a recently-accessed-log to hold employee IDs (strings) uniquely in Last-In-First Out order . A recently-accessed-log is initially empty. The most recently added employee ID is first, the least recently added employee ID is last. Employee IDs in the list are unique, so duplicate insertions are moved rather than added. Null insertions (empty strings) are not allowed. .A bounded capacity can be specified, so there is an upper limit to the number of Employee IDs contained, with the least recently added Employee IDs dropped on overflow. Example1: Lets assume our input array of employee IDs is ("Eva", "Maxim", "Sophia" and buffer_size is 5. The array size is buffer-size, hence the output should be ('Sophia Input: String array and integer number Output: String array You are software engineer who is working on Iaaccess control system. Your task is to develop a recently-accessed-log to hold employee IDs (strings) uniquely in Last-In-First Out order . A recently-accessed-log is initially empty. The most recently added employee ID is first, the least recently added employee ID is last. Employee IDs in the list are unique, so duplicate insertions are moved rather than added. Null insertions (empty strings) are not allowed. .A bounded capacity can be specified, so there is an upper limit to the number of Employee IDs contained, with the least recently added Employee IDs dropped on overflow. Example1: Lets assume our input array of employee IDs is ("Eva", "Maxim", "Sophia" and buffer_size is 5. The array size is buffer-size, hence the output should be ('Sophia Input: String array and integer number Output: String array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!