Question: Can you help me with this code. I'm supposed to use while and for loops to solve it. public class LinkedBookList { private BookNode head;
Can you help me with this code. I'm supposed to use while and for loops to solve it.

public class LinkedBookList { private BookNode head; private int size; public LinkedBookList()5 head = null; size-e; //returns size of the list public int size(){ return size; //IMPLEMENT -- adds a book to the end of the linked list public void add(Book b)( BookNode anew BookNode(b); head ; BookNode current if ( headnull ) 1 head a; return ; while (current . getNext ( ) != null ) { currentcurrent.getNext() ; current.setNext(a); //current-last element return; //IMPLEMENT -- adds a book at the specific index, // or at the end if index is greater than size public void add (Book b, int index) return; //IMPLEMENT -- removes a book and returns it, or // returns null if book is not present public Book remove (Book b){ return null
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
