[精華版STL]
//STL 資料結構
#include<queue>//佇列,堆
#include<stack>//棧
#include<map>//map
#include<string>
using namespace std;
queue<int> que;//佇列
stack<int> sta;//棧
priority_queue<int>heap;//堆
map<int,int>ma;//map
map<int, map<int,int>/*空格*/ >ha;//二維
map<string,int>mas;//map
int main()
{
佇列
{
que.push(3);//進入
int duitou=que.front();//隊頭的人
que.pop();//去掉第一個人
int people=que.size()//佇列長度
}
棧
{
sta.push(3);//進入
int zuishang=sta.top();//棧頂
sta.pop();//去掉棧頂的人
int people=sta.size();//棧高度
}
堆
{
heap.push(3);//進入
int zuida=heap.top();//最大值
heap.pop();//去掉最大值
int daxiao=heap.size();//堆大小
}
}
相關推薦
[精華版STL]
//STL 資料結構 #include<queue>//佇列,堆 #include<stack>//棧 #include<map>//map #include<string>using namespace std;queue<int> que;//佇
React-精華版
document images 兩個 world 組成 ins 結果 語言 opacity 現在最熱門的前端框架有AngularJS、React、Bootstrap等。自從接觸了ReactJS,ReactJs的虛擬DOM(Virtual DOM)和組件化的開發深深的吸引了
【知識學習】Sublime Text 快捷鍵精華版
輸入 效果 不同的 文件夾 nbsp enter 尾插 文件瀏覽 相同 1 Sublime Text 3 快捷鍵精華版 2 Ctrl+Shift+P:打開命令面板 3 Ctrl+P:搜索項目中的文件 4 Ctrl+G:跳轉到第幾行 5 Ctrl+W:關
Python 入門網絡爬蟲之精華版
網站 爬蟲 處理 通過 精華 免費 proxy params 華爾街 Python 入門網絡爬蟲之精華版 轉載 寧哥的小站,總結的不錯 Python學習網絡爬蟲主要分3個大的版塊:抓取,分析,存儲 另外,比較常用的爬蟲框架Scrapy,這裏最後也詳細介紹一
一看就懂的ReactJs入門教程-精華版-轉載
角度 ice ets perf date 入門實例 view 此外 map 傳送門:http://www.cnblogs.com/yunfeifei/p/4486125.html 現在最熱門的前端框架有AngularJS、React、Bootstrap等。自從接觸了R
Linux內核(9) - 精華版 之 方法論
http 完成 城市 post 重要 關心 基本 href 朋友 到目前為之,博客上分享的精華篇都可以歸為方法論的範疇,在很多時候,都是方法論要比細節緊要得多。而這些精華篇又可細分為三個專題:Linux大史記;內核學習的方法論;驅動開發的方法論。 Linux大史記 除去那些
linux中awk的使用(絕對精華版)
art if語句 算法 函數 格式 number num 返回 數值 在linux中awk絕對是核心工具,特別是在查找搜索這一領域,和掌握sed命令一樣重要 下面為awk的一些基本知識,基於這些知識,可以讓你隨意操控一個文件: 在awk中:()括號為條件塊,{}為執行的
傳智播客 劉意_2015年Java基礎視訊-深入淺出精華版 筆記(day01~day10)
本筆記是個人筆記+摘錄筆記相結合,非完全原創 day01 win 7系統開啟DOS有趣方法:按住shift+右鍵,單擊“在此處開啟命令視窗”(注意:在此處可以是任何的資料夾,不一定是桌面)用DOS刪除的檔案不可以在回收站恢復?!!常用DOS命令d: 回車 碟符切換dir(directory)
好好學Python,入門網路爬蟲之精華版!
Python學習網路爬蟲主要分3個大的版塊:抓取,分析,儲存。 另外,比較常用的爬蟲框架Scrapy,這裡最後也詳細介紹一下。 首先列舉一下本人總結的相關文章,這些覆蓋了入門網路爬蟲需要的基本概念和技巧: 學習Python中有不明白推薦加
傳智播客-劉意-java深入淺出精華版學習筆記Day01
計算機基礎知識:開啟控制行的方法:win+R,cmd回車Tips:1.切換碟符的時候大小寫無所謂。2.安裝軟體的時候在非系統盤裡建立一個新的目錄,把所有的程式檔案放到這個目錄起來,這樣既不佔系統盤空間,也不會把非系統盤搞得亂七八糟。3.刪除帶內容的資料夾:rd後加/s關鍵字,
單例模式的6種寫法及不同(精華版)
1、懶漢模式。執行緒不安全,但可以延遲 【不推薦,不使用】 <span style="font-size:12px;">public class Singleton1 { private static Singleton1 singleton1=nul
傳智播客 劉意_2015年Java基礎視訊-深入淺出精華版 筆記(2015年10月25日23:28:50)
day01 win 7系統開啟DOS有趣方法:按住shift+右鍵,單擊“在此處開啟命令視窗”(注意:在此處可以是任何的資料夾,不一定是桌面) 用DOS刪除的檔案不可以在回收站恢復?!! 常用DOS命令 d: 回車 碟符切換 dir(direct
傳智播客-劉意-java深入淺出精華版學習筆記Day07
成員變數和區域性變數的區別:成員變數:類中方法外 堆記憶體中 隨著物件的建立存在 隨著物件的消失而消失 有預設初始化值區域性變數:方法定義中或者方法宣告上
移動APP設計課程:iOS切圖與標註精華版
今天跟大家說的就是iOS版的切圖和標註。為什麼我們移動APP設計師完成設計稿之後,還要進行切圖和標註呢? 有些牛逼的ios程式設計師可以自己切圖自己弄。呵呵 首先我們要明白:標註和切圖的作用是,ios開發會按照標註的尺寸,把切圖按照高保真UI圖的擺放方式做到介面上。這個是減少後期修改的規範,也算是移動設
傳智播客--劉意Java基礎視訊-深入淺出精華版
package cn.itcast.test; import java.util.Scanner; import cn.itcast.dao.UserDao; import cn.itcast.dao.impl.UserDaoImpl; import cn.itcast.game.Gues
自動化測試基礎(精華版)
最近事情比較忙,好久沒更新部落格了。今天抽空來一篇自動化基礎的。 首先來看一下什麼是自動化測試,我們前面說過什麼是軟體測試,來回顧一下概念,軟體測試:通過手工或自動化手段來檢測軟體中的錯誤和缺陷的過程。那麼自動化測試呢?就是通過自動化手段來檢測軟體中的錯誤
【精華版】MyBatis生成逆向工程
1.加入相應的pom的jar包 <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybat
【精華版】mysql建立表(帶外來鍵)
建立department表: create table department( dept_name varchar(20), budget int, descript varchar(20), pr
傳智播客-劉意-java深入淺出精華版學習筆記Day08
工具中使用靜態:在同一個類中,main方法只能訪問靜態方法。【錯誤:無法從靜態上下文中引用非靜態,這樣的錯誤一定是因為在main方法中呼叫了非靜態方法。】對非靜態方法來說,只能通過物件(也就是其他類的物件)來呼叫非靜態方法。靜態方法當然也可以,而且靜態方法可以直接呼叫類名來訪
gdal讀寫影象分塊處理(精華版)(轉載)
/* 版權所有者:趙文 */ 一.gdal進行資料操作在安裝好gdal後,即可呼叫gdal庫中的函式。 (需要包含的標頭檔案:gdal_priv.h) 1.開啟資料集 使用gdal庫進行資料(影像)操作的第一步就是開啟一個數據集。對於“資料集”這個名詞大家可能不會太習慣,但是對於一般的格式來說,一個