🔄 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.
🔄 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:
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.