Add tests for other future queues

This commit is contained in:
Michael Bradley 2025-01-09 00:00:04 +13:00
parent ffe6a76241
commit 17b544f8bc
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
4 changed files with 269 additions and 6 deletions

View file

@ -25,6 +25,11 @@ class Queue[Data](ABC):
:return: The next item in the queue
"""
def pop(self) -> Data:
"""
:return: The next item in the queue
"""
class PureQueue[Data: Comparable](Queue[Data]):
"""
@ -36,11 +41,6 @@ class PureQueue[Data: Comparable](Queue[Data]):
:param items: An optional list of priorities with which to initialize the queue
"""
def pop(self) -> Data:
"""
:return: The next item in the queue
"""
def insert(self, item: Data) -> None:
"""
:param item: Item to insert into the queue
@ -87,3 +87,9 @@ class IndexedQueue[Data: Hashable, Priority: Comparable](Queue[Data]):
"""
:param key: The item to delete from the queue
"""
def __contains__(self, key: Data) -> bool:
"""
:param key: The item to check the existence of
:return: Whether the item is in the queue
"""