The parameterized class SList<E> represents singly linked lists with content type E. More...
#include <ogdf/basic/SList.h>
Inheritance diagram for ogdf::SList< E >:Public Types | |
| typedef SListConstIterator< E > | const_iterator |
| typedef SListElement< E > | element_type |
| typedef SListIterator< E > | iterator |
| typedef E | value_type |
Public Member Functions | |
| SList () | |
| Constructs an empty singly linked list. | |
| SList (const SList< E > &L) | |
| Constructs a singly linked list that is a copy of L. | |
| ~SList () | |
| const E & | back () const |
| Returns a reference to the last element. | |
| E & | back () |
| Returns a reference to the last element. | |
| const SListConstIterator< E > | begin () const |
| Returns an iterator to the first element of the list. | |
| SListIterator< E > | begin () |
| Returns an iterator to the first element of the list. | |
| void | bucketSort (int l, int h, BucketFunc< E > &f) |
| Sorts the list using bucket sort. | |
| void | bucketSort (BucketFunc< E > &f) |
| Sorts the list using bucket sort. | |
| void | clear () |
| Removes all elements from the list. | |
| void | conc (SList< E > &L2) |
| Appends L2 to this list and makes L2 empty. | |
| SListConstIterator< E > | cyclicSucc (SListConstIterator< E > it) const |
| Returns an iterator to the cyclic successor of it. | |
| SListIterator< E > | cyclicSucc (SListIterator< E > it) |
| Returns an iterator to the cyclic successor of it. | |
| void | delSucc (SListIterator< E > itBefore) |
| Removes the succesor of pBefore. | |
| bool | empty () const |
| Returns true iff the list is empty. | |
| SListConstIterator< E > | end () const |
| Returns an iterator to one-past-last element of the list. | |
| SListIterator< E > | end () |
| Returns an iterator to one-past-last element of the list. | |
| const E & | front () const |
| Returns a reference to the first element. | |
| E & | front () |
| Returns a reference to the first element. | |
| SListConstIterator< E > | get (int pos) const |
| Returns an iterator pointing to the element at position pos. | |
| SListIterator< E > | get (int pos) |
| Returns an iterator pointing to the element at position pos. | |
| const SListPure< E > & | getListPure () const |
| Conversion to const SListPure. | |
| SListIterator< E > | insertAfter (const E &x, SListIterator< E > itBefore) |
| Inserts element x after pBefore. | |
| void | moveFrontToBack (SList< E > &L2) |
| Moves the first element of this list to the end of list L2. | |
| void | moveFrontToFront (SList< E > &L2) |
| Moves the first element of this list to the begin of list L2. | |
| void | moveFrontToSucc (SList< E > &L2, SListIterator< E > itBefore) |
| Moves the first element of this list to list L2 inserted after itBefore. | |
| SList< E > & | operator= (const SList< E > &L) |
| Assignment operator. | |
| void | permute () |
| Randomly permutes the elements in the list. | |
| void | popFront () |
| Removes the first element from the list. | |
| E | popFrontRet () |
| Removes the first element from the list and returns it. | |
| int | pos (SListConstIterator< E > it) const |
| Returns the position (starting with 0) of it in the list. | |
| SListIterator< E > | pushBack (const E &x) |
| Adds element x at the end of the list. | |
| SListIterator< E > | pushFront (const E &x) |
| Adds element x at the begin of the list. | |
| void | quicksort () |
| Sorts the list using Quicksort. | |
| template<class COMPARER > | |
| void | quicksort (const COMPARER &comp) |
| Sorts the list using Quicksort and comparer comp. | |
| const SListConstIterator< E > | rbegin () const |
| Returns an iterator to the last element of the list. | |
| SListIterator< E > | rbegin () |
| Returns an iterator to the last element of the list. | |
| void | reverse () |
| Reverses the order of the list elements. | |
| int | search (const E &e) const |
| Scans the list for the specified element and returns its position in the list, or -1 if not found. | |
| template<class COMPARER > | |
| int | search (const E &e, const COMPARER &comp) const |
| Scans the list for the specified element (using the user-defined comparer) and returns its position in the list, or -1 if not found. | |
| int | size () const |
| Returns the length of the list. | |
Private Attributes | |
| int | m_count |
| The length of the list. | |
Additional Inherited Members | |
Private Types inherited from ogdf::SListPure< E > | |
Private Member Functions inherited from ogdf::SListPure< E > | |
| SListPure () | |
| Constructs an empty singly linked list. | |
| SListPure (const SListPure< E > &L) | |
| Constructs a singly linked list that is a copy of L. | |
| ~SListPure () | |
| void | conc (SListPure< E > &L2) |
| Appends L2 to this list and makes L2 empty. | |
| void | moveFrontToBack (SListPure< E > &L2) |
| Moves the first element of this list to the end of list L2. | |
| void | moveFrontToFront (SListPure< E > &L2) |
| Moves the first element of this list to the begin of list L2. | |
| void | moveFrontToSucc (SListPure< E > &L2, SListIterator< E > itBefore) |
| Moves the first element of this list to list L2 inserted after itBefore. | |
| SListPure< E > & | operator= (const SListPure< E > &L) |
| Assignment operator. | |
| void | copy (const SListPure< E > &L) |
| void | permute (const int n) |
The parameterized class SList<E> represents singly linked lists with content type E.
Elements of the list are instances of type SListElement<E>. Use SListConstIterator<E> or SListIterator<E> in order to iterate over the list. In contrast to SListPure<E>, instances of SList<E> store the length of the list and thus allow constant time access to the length.
| E | is the data type stored in list elements. |
| typedef SListConstIterator<E> ogdf::SList< E >::const_iterator |
Reimplemented from ogdf::SListPure< E >.
| typedef SListElement<E> ogdf::SList< E >::element_type |
Reimplemented from ogdf::SListPure< E >.
| typedef SListIterator<E> ogdf::SList< E >::iterator |
Reimplemented from ogdf::SListPure< E >.
| typedef E ogdf::SList< E >::value_type |
Reimplemented from ogdf::SListPure< E >.
|
inline |
|
inline |
|
inline |
|
inline |
Returns a reference to the last element.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns a reference to the last element.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator to the first element of the list.
If the list is empty, a null pointer iterator is returned.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator to the first element of the list.
If the list is empty, a null pointer iterator is returned.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Sorts the list using bucket sort.
| l | is the lowest bucket that will occur. |
| h | is the highest bucket that will occur. |
| f | returns the bucket for each element. |
Reimplemented from ogdf::SListPure< E >.
|
inline |
Sorts the list using bucket sort.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Removes all elements from the list.
Reimplemented from ogdf::SListPure< E >.
Reimplemented in ogdf::Queue< E >.
|
inline |
|
inline |
Returns an iterator to the cyclic successor of it.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator to the cyclic successor of it.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Removes the succesor of pBefore.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns true iff the list is empty.
Reimplemented from ogdf::SListPure< E >.
Reimplemented in ogdf::Queue< E >.
|
inline |
Returns an iterator to one-past-last element of the list.
This is always a null pointer iterator.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator to one-past-last element of the list.
This is always a null pointer iterator.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns a reference to the first element.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns a reference to the first element.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator pointing to the element at position pos.
The running time of this method is linear in pos.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator pointing to the element at position pos.
The running time of this method is linear in pos.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Conversion to const SListPure.
Reimplemented from ogdf::SListPure< E >.
Reimplemented in ogdf::Queue< E >.
|
inline |
Inserts element x after pBefore.
Reimplemented from ogdf::SListPure< E >.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Randomly permutes the elements in the list.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Removes the first element from the list.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Removes the first element from the list and returns it.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns the position (starting with 0) of it in the list.
Positions are numbered 0,1,...
Reimplemented from ogdf::SListPure< E >.
|
inline |
Adds element x at the end of the list.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Adds element x at the begin of the list.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Sorts the list using Quicksort.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Sorts the list using Quicksort and comparer comp.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator to the last element of the list.
If the list is empty, a null pointer iterator is returned.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns an iterator to the last element of the list.
If the list is empty, a null pointer iterator is returned.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Reverses the order of the list elements.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Scans the list for the specified element and returns its position in the list, or -1 if not found.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Scans the list for the specified element (using the user-defined comparer) and returns its position in the list, or -1 if not found.
Reimplemented from ogdf::SListPure< E >.
|
inline |
Returns the length of the list.
Reimplemented from ogdf::SListPure< E >.
Reimplemented in ogdf::Queue< E >.
|
private |