Add tests for other future queues
This commit is contained in:
parent
ffe6a76241
commit
17b544f8bc
4 changed files with 269 additions and 6 deletions
|
@ -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
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue