lrucacheleetcode-Leetcode:力码

时间:2024-07-19 17:01:24
【文件属性】:

文件名称:lrucacheleetcode-Leetcode:力码

文件大小:106KB

文件格式:ZIP

更新时间:2024-07-19 17:01:24

系统开源

lru缓存leetcode 力码 C++ STL 示例 队列(先进先出) empty() , push() , front() , back() , pop() , swap() , size() queue< int > q; cout << " Empty: " << q.empty() << endl; // Stdout ---- Empty: 1 q.push( 1 ); q.push( 2 ); q.push( 3 ); cout << " Front: " << q.front() << " , Back: " << q.back() << endl; // Stdout ---- Front: 1, Back: 3 q.pop(); cout << " Front: " << q.front() << endl; // Stdout ---- Front: 2 queue< int > q_; q_.swap(q); cout << " New queue size: " << q_.size() << " , Old queue size: " << q.size()


网友评论