Question: Design and implement a Java data structure class named BookShelf which has an array to store books and the size data member. The class should

Design and implement a Java data structure class named BookShelf which has an array to store books and the size data member. The class should have suitable constructors, get/set methods, and the toString method, as well as methods for people to add a book, remove a book, and search for a book.

Design and implement a Java class named Book with two data members: title and price.

Test the two classes by creating a bookshelf object and five book objects. Add the books to the bookshelf.

Display the contents of the bookshelf.

Now re-implement the Bookshelf class using a linkedlist and a Node class. Implement the above add, remove, and search methods again.

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!