Answer:
Check the explanation
Explanation:
An integer (int) is of two different bytes and each page has 200 bytes in length. What this means is that each row of array A (100 int) will fits perfectly in a page.
(a) For the initial or first array-initialization loop, one column is processed at a time, so a page fault will be generated at every inner loop iteration, with a total of 100*100=10,000 page faults.
(b) And when it comes to the second array-initialization loop, one row is processed at a time, and a page fault is generated at every outer loop iteration, with a total of 100 page faults.
Hence second array-initialization loop, has better spatial locality.
Answer:
Block 2
Explanation:
Cache mapping is a technique by which the contents of main memory are brought into the cache memory. we have three different types of cache mapping these are; direct, fully associative and k-way set associative mappings. In direct mapping such as the scenario above, the cache has one block in each set, so it is organized into X = Y sets, as such a particular block of main memory can map to only one particular line of the cache and the formula for determining the line number of cache to which a particular block can map is given by (main memory block address) %(number of lines in cache)
Answer:
#include <iostream>
#include <vector>
using namespace std;
void swapFrontBack(vector<int>& nums) {
if(nums.size() < 2) {
return;
}
swap(nums[0], nums[nums.size()-1]);
}
void printit(vector<int>& arr) {
for(int i = 0; i < arr.size(); i++) {
cout << arr[i] << " ";
}
cout << endl;
}
int main() {
vector<int> num1;
swapFrontBack(num1);
printit(num1);
num1.push_back(1);
swapFrontBack(num1);
printit(num1);
num1.push_back(2);
swapFrontBack(num1);
printit(num1);
vector<int> num2(10, 1);
num2[9] = 2;
swapFrontBack(num2);
printit(num2);
return 0;
}
Explanation:
Evet hocam proje konularını da bir insan değilim ki bir şey olmaz ya o yüzden bir insan bir arar bir şey olmaz sen kaç gibi müsait olur musun lütfen bilenler please urgent please beğenmedim ben çok iyi akşamlar yarın görüşürüz iyi geceler Allah rahatlık versin seni seviyorum çok öpüyorum iyi akşamlar yarın görüşürüz iyi geceler Allah rahatlık versin seni
Answer:
getting a motorcycle and getting a tattoo