Question: contacs.cpp and contacts.h are below. contacts.cpp #include using namespace std; #include Contacts.h ContactNode::ContactNode() {} ContactNode::ContactNode(string initName, string initPhoneNum, ContactNode* nextLoc) { this->contactName = initName; this->contactPhoneNum

 contacs.cpp and contacts.h are below. contacts.cpp #include using namespace std; #include

contacs.cpp and contacts.h are below.

contacts.cpp

#include using namespace std; #include "Contacts.h" ContactNode::ContactNode() {} ContactNode::ContactNode(string initName, string initPhoneNum, ContactNode* nextLoc) { this->contactName = initName; this->contactPhoneNum = initPhoneNum; this->nextNodePtr = nextLoc; return; } void ContactNode::InsertAfter(ContactNode* nodePtr) { ContactNode* tmpNext = 0; tmpNext = this->nextNodePtr; this->nextNodePtr = nodePtr; nodePtr->nextNodePtr = tmpNext; return; } string ContactNode::GetName() const { return this->contactName; } string ContactNode::GetPhoneNumber() const { return this->contactPhoneNum; } ContactNode* ContactNode::GetNext() { return this->nextNodePtr; } void ContactNode::PrintContactNode() { cout contactName contactPhoneNum

contacts.h

#ifndef CONTACTS_H #define CONTACTS_H #include using namespace std; class ContactNode { public: ContactNode(); ContactNode(string initName, string initPhoneNum, ContactNode* nextLoc = 0); void InsertAfter(ContactNode* nodePtr); string GetName() const; string GetPhoneNumber() const; ContactNode* GetNext(); void PrintContactNode(); private: string contactName; string contactPhoneNum; ContactNode* nextNodePtr; }; #endif

Project 10 C++ Create a Linkedi.ist Class: class LL public: LL O2 void InsertFront (ContactNode cn) i void InsertBack (ContactNode cn) void Printlist : private: 2 ContactNode head ContactNode tail: Write a program that: 1) Creates a linked 1ist of 50000 ContactNodes (from Contacts.h and Contacts.cpp). Insert each ContactNode to the front of the 1ist. Time how long it takes to insert all of the nodes into your linked ist 2) Creates a vector. Add 50000 Contacthodes (from Contacts.h and Contacts.cpp) to your vector by inserting them one at a time at the beginning of the vector. Your vector contains Contactlodes (not pointers to contact nodes). Time how long it takes to insert all of the nodes into your vector 3) Creates a vector. Add 50000 pointers to ContactNodes (from Contacts.h and Contacts.cpp) to your vector by inserting them one at a time at the beginning of the vector. Time how long it takes to insert all of the pointers into your vector include clock t begin, end double time spenti begin clock(); end clock ) time spent (double) (end-begin) CLOCK PER SEC Example output: Time creating linked list: (HIDDEN) Time creating vector: (HIDDEN) Time creating vector of pointers to contact nodes: (HIDDEN)

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!