82 for (
int i = 0; i < list.
size(); i++)
83 cout << list[i] <<
" ";
87 for (
int i = 0; i < list.
size(); i++)
88 cout << list[list.
size() - i - 1] <<
" ";
Core header for the Aleph-w library.
Iterator specialized for DynSlist returning payload references.
T & get_curr()
Return a reference to the current payload.
Dynamic list of elements of type T implemented with a singly linked list of nodes.
size_t size() const noexcept
Return the number of stored elements.
void remove(const int pos)
Remove the node at position pos.
void insert(const int pos, const T &data)
Insert an element at position pos.
void reset_first() noexcept
Reset the iterator to the first node of the list.
void next()
Advance the iterator to the next node.
bool has_curr() const noexcept
Return true if the iterator currently points to a node.
Dynamic singly linked list.