Java Reference
In-Depth Information
*24.12
(
Animation: queue
) Write a program to animate the
enqueue
and
dequeue
operations on a queue, as shown in FigureĀ 24.20b.
*24.13
(
Fibonacci number iterator
) Define an iterator class named
FibonacciIterator
for iterating Fibonacci numbers. The constructor takes an argument that
specifies the limit of the maximum Fibonacci number. For example, new
FibonacciIterator(23302)
creates an iterator that iterates Fibonacci num-
bers less than or equal to
23302
. Write a test program that uses this iterator to
display all Fibonacci numbers less than or equal to
100000
.
*24.14
(
Prime number iterator
) Define an iterator class named
PrimeIterator
for iter-
ating prime numbers. The constructor takes an argument that specifies the limit
of the maximum prime number. For example, new
PrimeIterator(23302)
creates an iterator that iterates prime numbers less than or equal to
23302
. Write
a test program that uses this iterator to display all prime numbers less than or
equal to
100000
.
**24.15
(
Test
MyArrayList
) Design and write a complete test program to test if the
MyArrayList
class in Listing 24.3 meets all requirements.
**24.16
(
Test
MyLinkedList
) Design and write a complete test program to test if the
MyLinkedList
class in Listing 24.6 meets all requirements.
Search WWH ::
Custom Search