Question: Java Programming Question 9 Assume no dummy nodes are being used. Assume we have a node reference called front . Assume nodes of type Node

Java Programming

Question 9

Assume no "dummy" nodes are being used. Assume we have a node reference called front. Assume nodes of type Node. Assume the list is not empty. Which of these correctly implements the addAtFront method, which is declared as follows: public void addAtFront(int value) { ... }

Group of answer choices:

  1. Node newNode = new Node(value); front = newNode;
  2. Node newNode = new Node(value); newNode.next = front; front = newNode;
  3. front = new Node(value);
  4. front = value;

Question 10

Select all the correct statements about doubly linked lists (vs. singly linked lists).

Group of answer choices:

  1. They typically have a "tail" or "end" reference as well as a "head" or "front" reference.
  2. The "I went too far" problem is less of a consideration, as you can navigate backwards with ease.
  3. It is not possible to "lose" parts of the list.
  4. They have a "prev" reference in addition to the "next" reference.
  5. Because of the additional references being stored, maintained, you will need two temporary variables when you add new nodes.
  6. When writing test cases, we need to keep in mind the "end" reference as a special case.

Question 7

Which of these should be taken into consideration when testing linked-list code?

Group of answer choices:

  1. empty list
  2. "interesting" thing at the beginning
  3. "interesting" thing at the end
  4. "interesting" thing in the middle
  5. list is full

Question 8

Neither arrays (and typical array algorithms) nor linked lists (and typical linked-list algorithms) use a significant amount of computer stack memory.

Group of answer choices:

True

False

Question 5

Which of these concepts is typically not associated with linked lists?

Group of answer choices:

  1. node class
  2. front node reference
  3. private node data
  4. traversing

Question 6

Memory allocation associated with adding to a linked list is less likely to fail than memory allocation associated with adding a new item to an array list.

Group of answer choices:

True

False

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!