
14.14 Exercises,Problems,and Projects 1103
EXERCISES,PROBLEMS, AND PROJECTS
❑ front = 7; back = 6; the queue is empty
❑ front = 2; back = 1; the queue is empty
❑ front = 2; back = 6; the queue is empty
❑ front = 6; back = 2; the queue is empty
14.14.2 Reading and Understanding Code
For Questions 14 to 21, consider the following classes from this chap-
ter: Player, PlayerNode, and PlayerLinkedList.
14. What does this method of the PlayerLinkedList class do?
public void foo1( Player p, Player q )
{
insert( p );
insert( q );
}
15. What does this method of the PlayerLinkedList class do?
public int foo2()
{
PlayerNode nd = head;
int i = 0;
while ( nd != null )
{
i++; ...