40 while (curr != NULL) {
69 while (curr != NULL) {
70 os <<
" " << curr->
data;
78 ostream& operator<<(ostream& os, const List<T>& list) {
94 List<T>::List(
const Iter& begin_iterator,
const Iter& end_iterator)
97 for (Iter i = begin_iterator; i != end_iterator; ++i)
ListNode * tail_
The tail of the list.
Definition: List.h:223
List< T > & operator=(const List< T > &rhs)
Overloaded assignment operator for Lists.
Definition: List-given.hpp:15
void _copy(const List< T > &other)
Copies the given list into the current list.
Definition: List-given.hpp:29
bool empty() const
Determines if the current List is empty.
Definition: List-given.hpp:24
int length_
The length of the current List.
Definition: List.h:228
int size() const
Gets the size of the List.
Definition: List-given.hpp:5
const T data
The data contained in this node.
Definition: List.h:60
List: This is a templated linked list class (meaning it contains data of templated type T...
Definition: List.h:21
The ListNode class is private to the List class via the principle of encapsulation—the end user does...
Definition: List.h:28
void print(ostream &os) const
Used to print the list.
Definition: List-given.hpp:66
ListNode * head_
The head of the List.
Definition: List.h:218
ListNode * next
A pointer to the next node in the list.
Definition: List.h:48
void insertBack(const T &ndata)
Inserts a new node at the back of the List.
Definition: List.hpp:62
ListNode()
Default ListNode constructor.
Definition: List-given.hpp:85
ListNode * prev
A pointer to the previous node in the list.
Definition: List.h:54
List()
Default List constructor.
Definition: List-given.hpp:2