1 The following class framework corresponds to the class pub

1. The following class framework corresponds to the class

public class ClassName
{
               private int info;
               private ClassName next;

               //Class methods
}

       Node.
       array-based list.
       List.
       doubly linked list.

2. What linked list operation does the operation method below define?

               public boolean operation()
               {
                              return (first.getNext() == null);
               }
       It initializes the linked list.
       It determines if the list is empty.
       It inserts an element in the linked list.
       It displays the list elements.

Solution

1. The class based on its structure is that of a linked list as if you visualize this class, it would be something like

[1, -]->[2, -]->[3, -]->null

Now, going through the options

So, correct option is A which is node

2. first.getNext() would return the node of head and is checking whether it exists or not. Also, it is not altering or displaying anything, the correct option here is B which is It determines if the list is empty.

1. The following class framework corresponds to the class public class ClassName { private int info; private ClassName next; //Class methods } Node. array-based

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site