Skip to content
New issue

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

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

Already on GitHub? Sign in 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
Contributor

@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 6 times, most recently from 9f65c01 to 35a87f8 Compare December 10, 2023 15:20
@polytypic polytypic force-pushed the add-optional-capacity-to-queue branch from 35a87f8 to 1964d7c Compare December 18, 2023 17:40
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant