class LRUCache提供两个接口:get(int key)和set(int key,value)
#includeusing namespace std; class LRUCache{ public: LRUCache(int cap):current(0),capacity(cap){ A=new node[cap]; } int get(int key) { for(int i=0;i
测试:
class LRUCache提供两个接口:get(int key)和set(int key,value)
#includeusing namespace std; class LRUCache{ public: LRUCache(int cap):current(0),capacity(cap){ A=new node[cap]; } int get(int key) { for(int i=0;i
测试: