Question: C++ Linked List Program Help Rating all working solution thumbs up! My code is posted below. Assignment Details : My code: #include using namespace std;

C++ Linked List Program Help

Rating all working solution thumbs up! My code is posted below.

Assignment Details:

C++ Linked List Program Help Rating all working solution thumbs up! My

My code:

#include

using namespace std;

/*Linked List requirements

Finding a node, removing a node, displaying the entire list,

adding at the head.

*/

template

struct node

{

T data;

node *next;

};

template

class llist

{

public:

void search(T item);

private:

node *head;

node *tail;

};

/*

template

void llist::search(T item)

{

for (int i = 0; i

{

if(numNodes[i] == item)

return true;

}

return false;

}

*/

int main()

{

/*

llist ilist;

ilist.add(100);

ilist.add(200);

ilist.add(50);

ilist.display();

int location = ilist.find(200);

if (location >= 0)

cout

else

cout

location = ilist.find(1000);

if (location >= 0)

cout

else

count

ilist.remove(100);

ilist.remove(800);

ilist.remove(50);

ilist.display();

location = ilist.find(200);

if (location >= 0)

cout

else

cout

location = ilist.find(100);

if (location >= 0)

cout

else

cout

*/

return 0;

}

This assignment will involve creating a linked list class consisting of nodes that will, in addition to the requisite link, contain a piece of data determined by the use of a template. You must support finding a node, removing a node, displaying the entire list, and adding (at the head). You must also implement a destructor, but you do not need to rewrite the copy constructor or the You may assume that all data stored in the linked list will be unique (i.e. if you find a specific key then you will only find it once). Your main body should be as shown below int main () llist ilist; ilist.add (100); ilist.add (200) ilist.add (50) ilist.displayO int location ilist.find (200) if (location >= 0) cout 0) cout = 0) cout

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!