Data structures

81 Views Asked by At

The queue we are considering will have the following three stages. Stage 1 : The queue will not start dequeuing items till it collect 2000 data points. Stage 2 : Once the 2000 data points are collected the queue will enqueue twice as fast as data is dequeued till the queue length becomes 20,000 data points. Stage 3 : The last stage will dequeue the data while no enqueuing occurs till the queue is empty. You may assume the data are integers. Carry out the following tasks in order to complete the worksheet. Helper programs are listed in Appendix A. Task 1 : Develop the queue using a dynamic array and test for the operations of the three states given above. Task 2 : Find the worst case running times for enqueue, dequeue, isEmpty, and isFull operation of the queue during the three stages. Task 3 : Develop the queue using a singly linked list and test for the operations of the three states given above.