singly linked list improvements

This commit is contained in:
Robin Müller 2020-06-17 20:37:45 +02:00
parent 259517ac9b
commit bb16fd80b8

View File

@ -61,8 +61,8 @@ public:
this->next = next;
}
void setEnd() {
this->next = nullptr;
virtual void setEnd() {
this->next = nullptr;
}
LinkedElement* begin() {
@ -107,6 +107,11 @@ public:
void setStart(LinkedElement<T>* setStart) {
start = setStart;
}
void setEnd(LinkedElement<T>* setEnd) {
setEnd->setEnd();
}
protected:
LinkedElement<T> *start = nullptr;
};