Write a peek method for a stack implemented as a linked structure. You may assume that the implementation has the top element of the stack referenced by a LinearNode reference top.
What will be an ideal response?
```
public T peek() throws EmptyCollectionException
{
if (isEmpty() )
throw new EmptyCollectionException("stack");
T result = top.getElement();
return result;
}
```
You might also like to view...
Which of the following is TRUE about sharing software?
A) When a desktop computer uses software from a server, the software files remain permanently in RAM of the desktop computer. B) Even if software is installed on a server, portions of it must also be installed on the desktop computers. C) If the server where the software is installed is not functioning, the other desktop computers can still use the software. D) Software only has to be installed and updated on one computer.
Controls can be added to Header and Footer sections
Indicate whether the statement is true or false
Which of the following options in the Hue/Saturation Properties panel is necessary for colorizing a black-and-white image?
A. Spot Color B. Drop Shadow C. Colorize D. RGB
Left alignment of text can also be called ________
A) flush right B) flush left C) centered D) justified