Skip to content

Commit

Permalink
update: changed linked list
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohith-Raju committed May 11, 2024
1 parent e61d85c commit 636504f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions include/LinkedList.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,10 @@ template <typename T> void LinkedList<T>::deep_clean(Node *&list) {
* insert_first() inserts element only when there are no elements in the list
*/
template <typename T> void LinkedList<T>::insert_first(Node *node) {
if (!is_empty()) {
head = node;
size_counter = 1;
if (tail == nullptr) {
tail = head;
}
head = node;
size_counter = 1;
if (tail == nullptr) {
tail = head;
}
return;
}
Expand Down

0 comments on commit 636504f

Please sign in to comment.