给每个算法添加复杂度的描述
This commit is contained in:
@@ -121,6 +121,7 @@ namespace TinySTL{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//********* [push_heap] ***************
|
//********* [push_heap] ***************
|
||||||
|
//********* [Algorithm Complexity: O(lgN)] ****************
|
||||||
template <class RandomAccessIterator>
|
template <class RandomAccessIterator>
|
||||||
void push_heap(RandomAccessIterator first, RandomAccessIterator last){
|
void push_heap(RandomAccessIterator first, RandomAccessIterator last){
|
||||||
TinySTL::push_heap(first, last,
|
TinySTL::push_heap(first, last,
|
||||||
@@ -131,6 +132,7 @@ namespace TinySTL{
|
|||||||
TinySTL::up(first, last - 1, first, comp);
|
TinySTL::up(first, last - 1, first, comp);
|
||||||
}
|
}
|
||||||
//********* [pop_heap] ***************
|
//********* [pop_heap] ***************
|
||||||
|
//********* [Algorithm Complexity: O(lgN)] ****************
|
||||||
template <class RandomAccessIterator>
|
template <class RandomAccessIterator>
|
||||||
void pop_heap(RandomAccessIterator first, RandomAccessIterator last){
|
void pop_heap(RandomAccessIterator first, RandomAccessIterator last){
|
||||||
TinySTL::pop_heap(first, last,
|
TinySTL::pop_heap(first, last,
|
||||||
@@ -143,6 +145,7 @@ namespace TinySTL{
|
|||||||
TinySTL::down(first, last - 2, first, comp);
|
TinySTL::down(first, last - 2, first, comp);
|
||||||
}
|
}
|
||||||
//********* [sort_heap] ***************
|
//********* [sort_heap] ***************
|
||||||
|
//********* [Algorithm Complexity: O(N)] ****************
|
||||||
template <class RandomAccessIterator>
|
template <class RandomAccessIterator>
|
||||||
void sort_heap(RandomAccessIterator first, RandomAccessIterator last){
|
void sort_heap(RandomAccessIterator first, RandomAccessIterator last){
|
||||||
return TinySTL::sort_heap(first, last,
|
return TinySTL::sort_heap(first, last,
|
||||||
@@ -155,6 +158,7 @@ namespace TinySTL{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//********* [is_heap] ***************
|
//********* [is_heap] ***************
|
||||||
|
//********* [Algorithm Complexity: O(N)] ****************
|
||||||
template <class RandomAccessIterator>
|
template <class RandomAccessIterator>
|
||||||
bool is_heap(RandomAccessIterator first, RandomAccessIterator last){
|
bool is_heap(RandomAccessIterator first, RandomAccessIterator last){
|
||||||
return TinySTL::is_heap(first, last,
|
return TinySTL::is_heap(first, last,
|
||||||
|
|||||||
Reference in New Issue
Block a user