singly linked list improvements
This commit is contained in:
parent
259517ac9b
commit
bb16fd80b8
@ -61,7 +61,7 @@ public:
|
||||
this->next = next;
|
||||
}
|
||||
|
||||
void setEnd() {
|
||||
virtual void setEnd() {
|
||||
this->next = nullptr;
|
||||
}
|
||||
|
||||
@ -107,6 +107,11 @@ public:
|
||||
void setStart(LinkedElement<T>* setStart) {
|
||||
start = setStart;
|
||||
}
|
||||
|
||||
void setEnd(LinkedElement<T>* setEnd) {
|
||||
setEnd->setEnd();
|
||||
}
|
||||
|
||||
protected:
|
||||
LinkedElement<T> *start = nullptr;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user