1. Assume that the variable head is supposed to contain a reference to the first node in a linked list and that the linked list is empty. What value should head have? 2. Write a definition of a method...


1. Assume that the variable head is supposed to contain a reference to the first node in a linked list and that the linked list is empty. What value should head have?


2. Write a definition of a method isEmpty for the class StringLinkedList that returns true if the list is empty, that is, if it has no nodes.


3. What output is produced by the following code?


StringLinkedList list = new StringLinkedList();


list.addANodeToStart("A");


list.addANodeToStart("B");


list.addANodeToStart("C");


list.showList();

Nov 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here