Brett 2022-12-26 01:02:46 -05:00
parent 8b6f2978f5
commit a772fb42d5
1 changed files with 3 additions and 6 deletions

View File

@ -31,13 +31,10 @@ namespace BLT {
public: public:
void insert(const T& t) { void insert(const T& t) {
auto newNode = new node<T>(t, nullptr);
if (head == nullptr) if (head == nullptr)
head = newNode; head = new node<T>(t, nullptr);
else { else
newNode->next = head; head = new node<T>(t, head);
head = newNode;
}
} }
[[nodiscard]] const T& front() const { [[nodiscard]] const T& front() const {