Java Reference
In-Depth Information
FIGURE 3-3
Two linked desks, with the newest desk first
1 0
4
4
FIGURE 3-4
Three linked desks, with the newest desk first
1 0
4
20
2 0
Question 1 The instructor knows the address of only one desk.
a.
Where in the chain is that desk: first, last, or somewhere else?
b.
Who is sitting at that desk: the student who arrived first, the student who arrived last, or
someone else?
Question 2 Where in the chain of desks is a new desk added: at the beginning, at the end,
or somewhere else?
3.5
The following pseudocode details the steps taken to form a chain of desks by adding new desks to
the beginning of the chain:
// Process the first student
newDesk represents the new student's desk
New student sits at newDesk
Instructor memorizes the address of newDesk
Search WWH ::




Custom Search