Question: Help with Linked list for data structures with c++: Write a C++ program to implement a singly linked list of books. The book details should

Help with Linked list for data structures with c++:

Write a C++ program to implement a singly linked list of books. The book details should include the following: title, author, and ISBN. The program should include the following functions:

*addBook: This is a function to add a new book to the list.

*isInList: This is a function to check if a book exists in the list.

*compareLists: This is a function to check whether two lists have the same books.

The user should be allowed to chose and enter this information. I need help completing this program.

My current code:

#include

using namespace std;

struct node

{

int data;

node *next;

};

class linked_list

{

private:

node * head, *tail;

public;

linked_list()

{

head = NULL;

tail = NULL;

}

void addBook(int b)

{

node *tmp = new node;

tmp->data = b;

tmp->next = NULL;

if (head == NULL)

{

head = tmp;

tail = tmp;

}

else

{

tail->next = tmp;

tail = tail->next;

}

}

};

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!