Skip to content

corrected time complexity of Stack and Queue Access and Search Operations#163

Open
iqmd wants to merge 2 commits intoericdrowell:masterfrom
iqmd:stack_patch
Open

corrected time complexity of Stack and Queue Access and Search Operations#163
iqmd wants to merge 2 commits intoericdrowell:masterfrom
iqmd:stack_patch

Conversation

@iqmd
Copy link
Copy Markdown

@iqmd iqmd commented Feb 3, 2024

🔄 Pull Request: Update Time Complexity for Stack and Queue Access and Search Operations

Changes Proposed:
In this pull request, I propose updating the time complexity for accessing and searching elements within the Stack and Queue to be marked as N/A.

Details:

  • Old Documentation:
    • Stack and Queue access and search operations were previously O(N) .
  • Proposed Documentation:
    • Updated the time complexity to N/A.

Note: While accessing the top element is a constant time operation and we might be able to search or access with several peek() operations in O(n) time complexity but it's not supported by both stack and queue ADT.

@iqmd iqmd changed the title corrected time complexity of Stack and Queue Access Operations corrected time complexity of Stack and Queue Access and Search Operations Feb 3, 2024
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.

1 participant