mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
git mv data_structures/queue data_structures/queues (#12577)
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
committed by
GitHub
parent
338cbafe0d
commit
738253e800
@@ -17,7 +17,9 @@ class CircularQueue:
|
||||
>>> len(cq)
|
||||
0
|
||||
>>> cq.enqueue("A") # doctest: +ELLIPSIS
|
||||
<data_structures.queue.circular_queue.CircularQueue object at ...
|
||||
<data_structures.queues.circular_queue.CircularQueue object at ...
|
||||
>>> cq.array
|
||||
['A', None, None, None, None]
|
||||
>>> len(cq)
|
||||
1
|
||||
"""
|
||||
@@ -51,11 +53,13 @@ class CircularQueue:
|
||||
as an index.
|
||||
>>> cq = CircularQueue(5)
|
||||
>>> cq.enqueue("A") # doctest: +ELLIPSIS
|
||||
<data_structures.queue.circular_queue.CircularQueue object at ...
|
||||
<data_structures.queues.circular_queue.CircularQueue object at ...
|
||||
>>> (cq.size, cq.first())
|
||||
(1, 'A')
|
||||
>>> cq.enqueue("B") # doctest: +ELLIPSIS
|
||||
<data_structures.queue.circular_queue.CircularQueue object at ...
|
||||
<data_structures.queues.circular_queue.CircularQueue object at ...
|
||||
>>> cq.array
|
||||
['A', 'B', None, None, None]
|
||||
>>> (cq.size, cq.first())
|
||||
(2, 'A')
|
||||
"""
|
||||
@@ -59,12 +59,12 @@ class FixedPriorityQueue:
|
||||
>>> fpq.dequeue()
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
data_structures.queue.priority_queue_using_list.UnderFlowError: All queues are empty
|
||||
data_structures.queues.priority_queue_using_list.UnderFlowError: All queues are empty
|
||||
>>> print(fpq)
|
||||
Priority 0: []
|
||||
Priority 1: []
|
||||
Priority 2: []
|
||||
"""
|
||||
""" # noqa: E501
|
||||
|
||||
def __init__(self):
|
||||
self.queues = [
|
||||
@@ -141,7 +141,7 @@ class ElementPriorityQueue:
|
||||
>>> epq.dequeue()
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
data_structures.queue.priority_queue_using_list.UnderFlowError: The queue is empty
|
||||
data_structures.queues.priority_queue_using_list.UnderFlowError: The queue is empty
|
||||
>>> print(epq)
|
||||
[]
|
||||
"""
|
||||
Reference in New Issue
Block a user