template<class _RanIt,class _Pr> inline
void sort(const _RanIt _First, const _RanIt _Last, _Pr _Pred)
全排序,整個容器排序。算法
template<class _RanIt,class _Pr> inline
void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred)
設定排序區間大小,即設定局部全排序排序
template<class _RanIt,class _Pr> inline
void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last, _Pr _Pred)
選出符合條件的前n個,這n個不排序element
template<class _FwdIt,class _Pr> inline
_FwdIt partition(_FwdIt _First, const _FwdIt _Last, _Pr _Pred)
對整個容器分區,根據符合的條件分區。返回的迭代器指向第一個不符合條件的元素。資源
1, 2, 3, 4都要求是隨機迭代器,因此只能應用在vector,string,deque。get
選擇排序算法string