ex4's Introduction
FILES: README - this file Makefile - a compilation file Algorithm.cpp - An implementation of the Algorithm given between FBR, LRU, FLU Algorithm.h- The header of the implementation of the Algorithm given between FBR, LRU, FLU Block.cpp- An implementation of a wrapper of the memory block Block.h-The header of the implementation of ta wrapper of the memory block CacheFS.cpp - An implementation of the program which implement a library of cache algorithms REMARKS: Implementation: Our program has a class of Algorithm that implement the require algorithm according to the user input * We decided not to use inheritance from the reason that all the algorithms can behave the same as FBR with fixed parameters of the new and old sections. When the user init the progarm we create a global instant of Algorithm which run all he function needed. Our Block file is a wrapper of the memory stored in the cache which save parameters that helps to run the program. In the algorithm class we save the following data structures: vectorOfBlocks - Which is like as name can implement as vector of blocks pointers that represent that cache. We have decided to store the blocks in the vector frm the reason we can use it as a stack for the algorithms and we save the hassle of looking in O(n) in the fact we also implemented a hash table of flags that tell according to a full path if the block exist. so miss cost O(1). fidToPath - Which is an unordered_map from file Id to a full path. We have decided to implement this data structure because we realized that he only indicator if we have saved a memory block of a file is according is full path. Because we also just need to add and to erase values an unordered_map would be the best way. pathToVectorOfBlocks - Which is an unordered_map from a full path to the file vector of booleans. This structure tells us if we already allocated memory for a certain block in the cache. This way we make the search for a block which isn't in the cache to O(1). ANSWERS: in the Answers.pdf file
ex4's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.