1.stl(standard template library)廣義上分為三大元件: 容器 ,演算法, 迭代器
細分為六大元件:
(1)容器
(2)演算法
(3)迭代器
(4)仿函式
(5)介面卡
(6)空間配置器
stl優點:(1)高可重用性 :模板類,模板函式
(2)高效能 :例如map可以從十幾萬資料快速查詢資料,使用紅黑樹機制
(3)高可移植
(4)跨平台
元件 ----容器
(1)序列式容器:vector;dequeue;list;
(2)關聯式容器:set/mulitiset ; map/mulitimap
元件 ----迭代器(遍歷)
(1)輸入迭代器
(2)輸出迭代器
(3)前向迭代器
(4)雙向迭代器
(5)隨機訪問迭代器
STL六大元件
stl提供六大元件,彼此可以組合套用。1 容器 containers 各種資料結構。如vector,list,deque,set,map,用來存放資料。容器又可以分為順序容器和關聯容器.順序容器 vector,list,deque,stack,queue,heap,priority queue,sl...
STL 六大元件
1.容器 containers 各種資料結構,如vector,list,deque,set,map,用來存放資料。從實現的角度看,stl容器是一種class template。2.演算法 algorithms 各種常用的演算法如sort,search,copy,erase 從實現的角度看,stl演算...
STL六大元件
容器 containers 各種資料結構,如 vector list deque set map 用來存放資料。演算法 algorithms 各種常用演算法,如 sort search copy erase 分配器 allocators 負責空間配置與管理。迭代器 iterators 容器與演算法之...