Python: Using an Array to represent a Stack, Queue, and Circular Queue

preview_player
Показать описание
Python: Using an Array to represent a Stack, Queue, and Circular Queue. Complete module here:
Рекомендации по теме
Комментарии
Автор

There is an initialization bug I think. Assume we create a queue, then call queue.clear(), then queue.push(1), then queue.pop(), we would attempt to access the (-1)th element which isn't correct.

RamiAwar
Автор

How can I make that the user can define the max size of the queue?

Rayni