mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-21 08:42:03 +00:00
git mv data_structures/queue data_structures/queues (#12577)
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
parent
338cbafe0d
commit
738253e800
|
@ -16,7 +16,7 @@ repos:
|
|||
- id: auto-walrus
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.9.4
|
||||
rev: v0.9.6
|
||||
hooks:
|
||||
- id: ruff
|
||||
- id: ruff-format
|
||||
|
@ -47,7 +47,7 @@ repos:
|
|||
- id: validate-pyproject
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.14.1
|
||||
rev: v1.15.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
args:
|
||||
|
|
18
DIRECTORY.md
18
DIRECTORY.md
|
@ -275,15 +275,15 @@
|
|||
* [Singly Linked List](data_structures/linked_list/singly_linked_list.py)
|
||||
* [Skip List](data_structures/linked_list/skip_list.py)
|
||||
* [Swap Nodes](data_structures/linked_list/swap_nodes.py)
|
||||
* Queue
|
||||
* [Circular Queue](data_structures/queue/circular_queue.py)
|
||||
* [Circular Queue Linked List](data_structures/queue/circular_queue_linked_list.py)
|
||||
* [Double Ended Queue](data_structures/queue/double_ended_queue.py)
|
||||
* [Linked Queue](data_structures/queue/linked_queue.py)
|
||||
* [Priority Queue Using List](data_structures/queue/priority_queue_using_list.py)
|
||||
* [Queue By List](data_structures/queue/queue_by_list.py)
|
||||
* [Queue By Two Stacks](data_structures/queue/queue_by_two_stacks.py)
|
||||
* [Queue On Pseudo Stack](data_structures/queue/queue_on_pseudo_stack.py)
|
||||
* Queues
|
||||
* [Circular Queue](data_structures/queues/circular_queue.py)
|
||||
* [Circular Queue Linked List](data_structures/queues/circular_queue_linked_list.py)
|
||||
* [Double Ended Queue](data_structures/queues/double_ended_queue.py)
|
||||
* [Linked Queue](data_structures/queues/linked_queue.py)
|
||||
* [Priority Queue Using List](data_structures/queues/priority_queue_using_list.py)
|
||||
* [Queue By List](data_structures/queues/queue_by_list.py)
|
||||
* [Queue By Two Stacks](data_structures/queues/queue_by_two_stacks.py)
|
||||
* [Queue On Pseudo Stack](data_structures/queues/queue_on_pseudo_stack.py)
|
||||
* Stacks
|
||||
* [Balanced Parentheses](data_structures/stacks/balanced_parentheses.py)
|
||||
* [Dijkstras Two Stack Algorithm](data_structures/stacks/dijkstras_two_stack_algorithm.py)
|
||||
|
|
|
@ -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)
|
||||
[]
|
||||
"""
|
Loading…
Reference in New Issue
Block a user