I\'m doing linked list right now can need help my programing seems to be freezin
ID: 3760450 • Letter: I
Question
I'm doing linked list right now can need help my programing seems to be freezing or seg faulting.
linkedlist.cpp: http://pastebin.com/7ebHzv7V
linkedlist.h: http://pastebin.com/Uw96vSkr
tester.cpp: http://pastebin.com/QtEWPz6s
The big three is (Assignment operator; Copy constructor; Destructor;)
think the main purpose of the client code in this assignment is to test class LL thoroughly. You should test general and boundary cases.For example, for void pop_front() function make sure if it works if:
--- list head is NULL;
--- one item in the list;
--- n items in the list;
--- show your list before and after deleting items;
--- something else.
Explanation / Answer
You forgot initialize head to null: This solved the issue
bool LL::empty() {
return head == NULL;
}
------------output------------------
0
5
2
4
0
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.