Impement a queue class for integers - TechRepublic
General discussion
March 12, 2001 at 05:52 AM
hsjd_afamily

Impement a queue class for integers

by hsjd_afamily . Updated 25 years, 2 months ago

I need help with the following application: I am in the process of developing two classes: Array and Linked list. A Client(main) should be able to use either of the two implementations transparently. The client will need to keep track of: 1.) The length of the queue, 2.) the number of times the dequeue method would be called when the queue is empty(I don’t have to call the method, but skip the call, record the event and continue). 3.) Record if an “Array index out of bound” exception is reported by the enqueue method. The client(main) will decide whether to call the enqueue or the dequeue method by using a dice(0 for dequeue or 1 for enqueue using the random number generator). If the enqueue is to be used, a random integer in the rangeof 1-1000 should be generated. This loop should run at least 200 times.

This discussion is locked

All Comments