|
优先级队列
0.1
数据结构_第7章
|
#include <seqList.h>
Classes | |
| class | const_iterator |
| class | iterator |
Public Member Functions | |
| seqList (size_t initSize=10) | |
| Construct a new seq List object. More... | |
| seqList (const seqList< T > &rhs) | |
| Construct a new seq List object. More... | |
| seqList (seqList< T > &&rvalue) | |
| Construct a new seq List object. More... | |
| seqList (const std::initializer_list< T > &init_list) | |
| Construct a new seq List object. More... | |
| virtual | ~seqList () |
| Destroy the seq List object. More... | |
| virtual void | clear () |
| virtual int | length () const |
| virtual void | insert (int i, const T &obj) |
| virtual void | remove (int i) |
| virtual int | search (const T &obj) const |
| virtual T | visit (int i) const |
| virtual void | traverse (std::ostream &out=std::cout) const |
| T & | operator[] (size_t index) |
| 下标访问(mutator) More... | |
| const T & | operator[] (size_t index) const |
| 下标访问(accessor) More... | |
| void | push_back (const T &x) |
| 在表尾插入新元素 More... | |
| void | push_back (T &&x) |
| 在表尾插入新元素 More... | |
| void | pop_back () |
| 删除表尾元素 More... | |
| size_t | size () const |
| 返回线性表的当前元素个数,即长度 More... | |
| size_t | capacity () const noexcept |
| Return size of allocated storage capacity. More... | |
| T & | front () |
| Access first element. More... | |
| const T & | front () const |
| Access first element. More... | |
| T & | back () |
| Access last element. More... | |
| const T & | back () const |
| Access last element. More... | |
| void | resize (size_t n) |
| Change size Resizes the container so that it contains n elements. More... | |
| void | reserve (size_t n) |
| Request a change in capacity. More... | |
| virtual iterator | begin () |
| virtual const_iterator | begin () const |
| virtual iterator | end () |
| virtual const_iterator | end () const |
Public Member Functions inherited from List::List< T > | |
| virtual | ~List ()=default |
Private Member Functions | |
| void | doubleSpace () |
Private Attributes | |
| T * | data |
| size_t | currentLength |
| size_t | maxSize |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const seqList &obj) |
| 将顺序表元素顺序插到输出流对象out中 More... | |
| List::seqList< T >::seqList | ( | size_t | initSize = 10 | ) |
| List::seqList< T >::seqList | ( | const seqList< T > & | rhs | ) |
| List::seqList< T >::seqList | ( | seqList< T > && | rvalue | ) |
| List::seqList< T >::seqList | ( | const std::initializer_list< T > & | init_list | ) |
|
virtual |
| const T & List::seqList< T >::back |
| const T& List::seqList< T >::back | ( | ) | const |
Access last element.
Returns a reference to the last element in the vector.
|
inlinevirtual |
|
inlinevirtual |
|
noexcept |
Return size of allocated storage capacity.
Returns the size of the storage space currently allocated for the vector, expressed in terms of elements. This capacity is not necessarily equal to the vector size. It can be equal or greater, with the extra space allowing to accommodate for growth without the need to reallocate on each insertion.
Notice that this capacity does not suppose a limit on the size of the vector. When this capacity is exhausted and more is needed, it is automatically expanded by the container (reallocating it storage space).
Member type size_type is an unsigned integral type.
|
virtual |
Implements List::List< T >.
Definition at line 298 of file seqList.h.
Referenced by Queue::BinaryHeap< int, std::greater< int > >::clear().
|
private |
|
inlinevirtual |
|
inlinevirtual |
| const T & List::seqList< T >::front |
Access first element.
Returns a reference to the first element in the vector.
| const T& List::seqList< T >::front | ( | ) | const |
Access first element.
Returns a reference to the first element in the vector.
|
virtual |
Implements List::List< T >.
Definition at line 389 of file seqList.h.
Referenced by List::operator+().
|
virtual |
Implements List::List< T >.
Definition at line 304 of file seqList.h.
Referenced by List::operator+().
| T & List::seqList< T >::operator[] | ( | size_t | index | ) |
| const T & List::seqList< T >::operator[] | ( | size_t | index | ) | const |
| void List::seqList< T >::pop_back |
删除表尾元素
Definition at line 455 of file seqList.h.
Referenced by Queue::BinaryHeap< int, std::greater< int > >::pop().
| void List::seqList< T >::push_back | ( | const T & | x | ) |
在表尾插入新元素
| x | 新元素 |
Definition at line 439 of file seqList.h.
Referenced by main(), and Queue::BinaryHeap< int, std::greater< int > >::push().
| void List::seqList< T >::push_back | ( | T && | x | ) |
|
virtual |
Implements List::List< T >.
| void List::seqList< T >::reserve | ( | size_t | n | ) |
Request a change in capacity.
Requests that the vector capacity be at least enough to contain n elements. If n is greater than the current vector capacity, the function causes the container to reallocate its storage increasing its capacity to n (or greater).\ In all other cases, the function call does not cause a reallocation and the vector capacity is not affected.\ This function has no effect on the vector size and cannot alter its elements.\
| n | Minimum capacity for the vector.\ Note that the resulting vector capacity may be equal or greater than n.\ Member type size_type is an unsigned integral type. |
| void List::seqList< T >::resize | ( | size_t | n | ) |
|
virtual |
Implements List::List< T >.
| size_t List::seqList< T >::size |
返回线性表的当前元素个数,即长度
Definition at line 310 of file seqList.h.
Referenced by Queue::BinaryHeap< int, std::greater< int > >::BinaryHeap(), and Queue::BinaryHeap< int, std::greater< int > >::size().
|
virtual |
|
virtual |
Implements List::List< T >.
Definition at line 316 of file seqList.h.
Referenced by List::operator+().
|
friend |
|
private |
Definition at line 29 of file seqList.h.
Referenced by List::seqList< value_type >::end().
|
private |
Definition at line 28 of file seqList.h.
Referenced by List::seqList< value_type >::begin(), and List::seqList< value_type >::end().
|
private |
Definition at line 30 of file seqList.h.
Referenced by List::seqList< value_type >::seqList().