Question: USC421 Assignment 2 (50 Points) Complete the following program named myLinkedlist.cpp to create a linked integer list and then display both lists. Compre lines: program

 USC421 Assignment 2 (50 Points) Complete the following program named myLinkedlist.cpp

to create a linked integer list and then display both lists. Compre

USC421 Assignment 2 (50 Points) Complete the following program named myLinkedlist.cpp to create a linked integer list and then display both lists. Compre lines: program named myLinkedlist.cpp to create a linked character list and a linked then display both lists. Compile your program and run your program using the command c++ -o myLinkedlist myLinkedlist.cpp ./myLinkedlist nc ni center> ere nc and ni are the number of entries in the character list and the integer list, respectively. // Student Name // Student ID // myLinkedlist.cpp #include #include #include #include using namespace std; template class myNode{ T data; myNode *next; public: myNode(Tv){data=v; next=NULL;} myNode(Tv, myNode *n){data=v; next=n;} template friend class myList; // node class // data W pointer to next node // constructor // constructor // list class // head pointer template class myList myNode *head; public: myList({head=NULL;} -myList(); bool emptyO{return !head;} int length(); void add(Tv); void append(Tv); void displayint m); // constructor // destructor Il empty or not // length of list // add to head // append to tail // display, m elements per line Il complete myList class here int main(int arge, char *argv[]) { int ncratoi(argv[1]); int ni=atoi(argv[2]; myList clist; myList ilist; const int m=8; srand(unsigned) time(NULL)); // program entrance 1/ number of characters to add // number of integers to append // character list // integer list // m items displayed per line // set random seed // create character list and display all entries int i=0; while(i

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!