leetcodepushfront Leetcode Interview Collection 收藏采访示例
leetcode push front Leetcode_Interview_Collection ===== *背景:题目来至leetcode和其它面试书的例子;代码有借鉴和自己改写和写注释; *目的:用github来记录自己; 001-->Judge_int_is_palindorme 002-->Not_Use_add 003-->全排列004->LRU C++代码: LRUCache(int capacity) t{ ttthis->capacity = capacity ; t} tint Get (int key ) t{ ttif (cacheMap.find(key) == cacheMap.end() ) return -1 ; ttcacheList.splice(cacheList.begin(), cacheList , cacheMap[key] ) ; ttcacheMap[key] = cacheList.begin(); ttreturn cacheMap[key]->value; t} void S
用户评论