Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
|
circularly linked list More...
#include <circularly_linked.h>
Public Member Functions | |
CircularlyLinkedList () | |
Constructs an empty list. | |
int | size () const |
bool | empty () const |
T & | front () |
const T & | front () const |
T & | back () |
const T & | back () const |
void | push_front (const T &elem) |
void | push_back (const T &elem) |
void | pop_front () |
Removes the first element of the list. | |
void | rotate () |
Rotates the first element to the back of the list. | |
void | clear () |
Resets the list to empty. | |
CircularlyLinkedList (const CircularlyLinkedList &other) | |
Copy constructor. | |
CircularlyLinkedList & | operator= (const CircularlyLinkedList &other) |
Copy assignment. | |
CircularlyLinkedList (CircularlyLinkedList &&other) | |
Move constructor. | |
CircularlyLinkedList & | operator= (CircularlyLinkedList &&other) |
Move assignment. | |
~CircularlyLinkedList () | |
default destructor | |
Friends | |
void | swap (CircularlyLinkedList &a, CircularlyLinkedList &b) |
non-member function to swap two lists | |
circularly linked list
|
inline |
Constructs an empty list.
|
inline |
Copy constructor.
|
inline |
Move constructor.
|
inline |
default destructor
|
inline |
Returns live reference to the last element of the list; behavior undefined if list is empty
|
inline |
Returns const reference to the last element of the list; behavior undefined if list is empty
|
inline |
Resets the list to empty.
|
inline |
Tests whether the list is empty.
|
inline |
Returns live reference to the first element of the list; behavior undefined if list is empty
|
inline |
Returns const reference to the first element of the list; behavior undefined if list is empty
|
inline |
Move assignment.
|
inline |
Copy assignment.
|
inline |
Removes the first element of the list.
|
inline |
Inserts element at the end of the list
elem | the new element |
|
inline |
Inserts element at the beginning of the list
elem | the new element |
|
inline |
Rotates the first element to the back of the list.
|
inline |
Returns the number of elements stored
|
friend |
non-member function to swap two lists