Question: Please using C++ implements those methods in the class BookList Private struct Node This is a private type definition. It will model each of the
Private struct Node This is a private type definition. It will model each of the nodes that will serve as "chain links" in the list. Every time a book is inserted in the list, a new node needs to be created. This structure is private because its structure does not need to be known outside of the class. Book data; Node next; Node prev Private operator-(const BookList&) Assignment operator overloaded (private to :BookList& its use its use) Private BookList(const BookList) Copy constructor (private to Private _ head: Node Points to the first node in the list. Will be nullptr if the list is e The number of nodes in the list. Uses delete to free up every node in the list. When a node is freed up, the Book object it points to is also freed Initializes head to nullptr and size to zero. Calls Destroylist to free up all allocated size: unsigned int Private Private DestroyList(): void Public BookList Public Bisto stored in the list PublicInsert(Book,size t) Inserts this pointer to a Book object into the given position. Allocates a node to store this pointer to a Book object. If the list currently is empty, set head to this node. Otherwise the node is linked into the list size is updated. Returns true Notice that the BookStore AddBook method is : bool
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
