Question: C++ Lab help!! Please can someone help me with my lab?? Cache #Size: int #numitem: int #dataCache: int[] #setsize(someSize :int ) :void +addItem(item: int):void +getIndexOfItem(item:
Cache #Size: int #numitem: int #dataCache: int[] #setsize(someSize :int ) :void +addItem(item: int):void +getIndexOfItem(item: int)int +getitemAtFrontO:int LRUCache LFUCache LRUCache (size: int +addItem (item: int):void +getIndexOfItem (item: int):int LFUCache (size: int) +addItem (item: int):void +getIndexOfItem (item: int):int Note that in UML,-means private, + means public, and # means protected. Protected members are accessible to the derived (child) class, but are not accessible outside the inheritance hierarchy. In other words, to the "outside world", it is the same as if they are private. The italics of the Cache class name and two of its member functions: addltem and getlndexOfltem is on purpose. These are pure virtual functions, meaning that the derived classes must implement them. There are no implementations in the abstract base class, Cache. ALGORITHMS Items in the cache can be searched for (getIndexOftem) or return- if they are not found. As the name suggests, when the cache becomes full, a replacement algorithm must be used to determine what item is removed from the cache so that the newest item can enter the cache. The
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
