Updated Linked List to look at head instead of count
This commit is contained in:
parent
23e7860e43
commit
700d6696c8
@ -42,7 +42,7 @@ namespace Datastructures {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void LinkedList<T>::append(T value) {
|
void LinkedList<T>::append(T value) {
|
||||||
mCount++;
|
mCount++;
|
||||||
if (mCount == 0) {
|
if (mHead == nullptr) {
|
||||||
mHead = std::make_shared<Nodes::LinkedListNode<T>>(value);
|
mHead = std::make_shared<Nodes::LinkedListNode<T>>(value);
|
||||||
mTail = mHead;
|
mTail = mHead;
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user