ericdrowell / BigOCheatSheet

1.07k stars 314 forks source link

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

Open iqmd opened 7 months ago

iqmd commented 7 months ago

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