Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote