Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add optional capacity to queue #74

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

polytypic
Copy link
Collaborator

@polytypic polytypic commented May 20, 2023

This PR adds optional capacity argument to Queue.create and Stack.create allowing one to create a bounded queue/stack.

TODO:

  • Add capacity to stack.
  • Allow setting the capacity.
    • If capacity is less than length then new elements cannot be added to the queue/stack.
    • Capacity can be set to 0 to effectively "close" the queue/stack.
  • Test operations with capacity <> Int.max_int

@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 17 times, most recently from a233cee to ac5ec6e Compare May 26, 2023 15:37
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 2 times, most recently from 0055649 to 6c207bb Compare May 31, 2023 21:22
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 4 times, most recently from 9b8e8ac to f63348f Compare June 11, 2023 06:58
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 3 times, most recently from dd93e95 to 27e78c0 Compare June 13, 2023 12:45
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 4 times, most recently from b204e29 to aa7c190 Compare June 28, 2023 07:25
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 7 times, most recently from 9a5c521 to cf67c18 Compare December 26, 2023 11:13
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 7 times, most recently from bd9ae40 to 2ff796d Compare December 31, 2023 19:07
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch from 2ff796d to 233185d Compare January 14, 2024 13:37
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 4 times, most recently from 8ab988d to 67c38a7 Compare January 25, 2024 16:53
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch from 67c38a7 to 62ca008 Compare March 13, 2024 08:54
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 2 times, most recently from 84d8214 to 0c6015f Compare July 17, 2024 08:17
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch from 0c6015f to af62788 Compare August 29, 2024 18:23
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch from af62788 to 5eed016 Compare September 20, 2024 18:11
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch 2 times, most recently from da98c1e to f3d0915 Compare November 10, 2024 15:46
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch from f3d0915 to 7757339 Compare December 16, 2024 10:23
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch from 7757339 to 184cb37 Compare December 16, 2024 10:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant