Question: C++ doubly Linked Lists - Complete the program below that keeps track of a telephone directory sorted by first name. Use the comments below to

C++

doubly Linked Lists - Complete the program below that keeps track of a telephone directory sorted by first name. Use the comments below to implement the routines that are not implemented.

C++ doubly Linked Lists - Complete the program below that keeps track

of a telephone directory sorted by first name. Use the comments belowto implement the routines that are not implemented. #include #include using namespace

#include

#include

using namespace std;

class DLL;

class Node

{

friend class DLL;

private:

string firstName;

string lastName;

string phoneNumber;

Node * nextRecord;

Node * previousRecord;

};

class DLL

{

private:

Node * head;

public:

DLL();

DLL(const DLL&); //optional

~DLL();

void insert(string, string, string);

void print();

void searchByName(string, string);

void remove(string, string);

};

//--------------------------------------------

//the default constructor

DLL::DLL()

{

}

//--------------------------------------------

//the copy constructor: optional

DLL::DLL(const DLL& source)

{

}

//--------------------------------------------

//the destructor

DLL::~DLL()

{

}

//--------------------------------------------

//print the linked list

void DLL::print ()

{

}

//--------------------------------------------

//search for a particular person in the list and print the

//corresponding phone number

void DLL::searchByName (string fName, string lName)

{

}

//--------------------------------------------

//create a node and insert it in the list in order (list

//should be sorted by the persons first name)

void DLL::insert (string fName, string lName, string phone)

{

}

//--------------------------------------------

//remove a person's record from the list

void DLL::remove (string fName, string lName)

{

}

//--------------------------------------------

int main ()

{

DLL list1;

list1.insert ("Mayssaa", "Najjar", "878-635-1234");

list1.insert ("Jim", "Meyer", "337-465-2345");

list1.insert ("Joe", "Didier", "352-654-1983");

list1.insert ("Yara", "Sarkis", "858-694-1787");

list1.insert ("Nancy", "Garcia", "617-227-5454");

list1.print();

list1.searchByName ("Nancy", "Garcia");

list1.remove ("Mayssaa", "Najjar");

list1.remove ("Yara", "Sarkis");

list1.remove ("Jim", "Meyer");

list1.print();

//this part is optional

DLL list2(list1);

list2.print();

return 0;

}

#include #include using namespace std; class DLL; class Node friend class DLL; private: string firstName; string lastName; string phoneNumber; Node * nextRecord; Node * previousRecord; class DLL private: public: Node * head; DLL ) DLL (const DLL&)//optional DLL void insert (string, string, string); void print); void searchByName (string, string) void remove (string, string); //thedefault constructor DLL:: DLL ( //the copy constructor: optional DLL: : DLL (const DLL& source)

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!