Skip to content

Update queue implementation#5391

Closed
Crowton wants to merge 1 commit intoTheAlgorithms:masterfrom
Crowton:patch-4
Closed

Update queue implementation#5391
Crowton wants to merge 1 commit intoTheAlgorithms:masterfrom
Crowton:patch-4

Conversation

@Crowton
Copy link
Copy Markdown
Contributor

@Crowton Crowton commented Oct 17, 2021

Popping first element from a list takes O(n) time.
Using cyclic queue takes O(1) time.

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

Popping first element from a list takes O(n) time.
Using cyclic queue takes O(1) time.
@ghost ghost added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Oct 17, 2021
@poyea
Copy link
Copy Markdown
Member

poyea commented Oct 18, 2021

Let's put this in #5388, as they're pretty much the same.

@ghost ghost removed the awaiting reviews This PR is ready to be reviewed label Oct 18, 2021
@poyea poyea closed this Oct 18, 2021
@Crowton Crowton deleted the patch-4 branch October 19, 2021 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants