ART MOMENT:
.
![]() |
The John Chandler Bancroft collection [Worcester Art Museum] of some 3,000 Japanese prints is internationally renowned. |
At the end of today's class you should
HAVE READ:
KNOW:
BE ABLE TO:
DAILY QUESTION:
/** Node
class representing an integer. */ public class NumberNode { int value; /* node value. */ NumberNode next; /* next one. */ public NumberNode (int i) { value = i; next = null; } } |
/** List of
numbers. */ public class NumberList { NumberNode head; /* first one. */ /** prepend a NumberNode with i to the front of the list. */ public void add (int i) { … } } |
Consider that you are shown the following method in the NumberList class:
/** Method in NumberList. */ public void doAnotherThing() { // prepend 3, then 5, then 7 to construct the list {7, 5, 3} add (3); add (5); add (7);
NumberNode node =
head;
|
What is the resulting list? Much of HW4 focused on your ability to perform such low-level manipulation of linked lists. You need to be able to understand the impact of these statements above.
Sample Exam question(s)