Question: Complete the methods of single linked lists // constructor MyLinkedList::MyLinkedList () { this->head = NULL; } // destructor to clean up all nodes MyLinkedList::~MyLinkedList ()

Complete the methods of single linked lists

// constructor MyLinkedList::MyLinkedList () { this->head = NULL; } // destructor to clean up all nodes MyLinkedList::~MyLinkedList () // Check if list is empty or not bool MyLinkedList::empty() const // return the value/elemnt at the front of the lsit const int& MyLinkedList::front() const

// add a node at the front of list void MyLinkedList::addFront(const int& elem) // remove the first node from the list void MyLinkedList::removeFront() // display all nodes of the linked list void MyLinkedList::display() const

//Load data from a file and add it to the Linked List void MyLinkedList::loadData(string path) //write the contents of the list to a file void MyLinkedList::dumpData(string path) const // sort the elments of the list using: Hint use bubble_sort void MyLinkedList::sort()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!