Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Python
/ peek
Method
peek
data_structures/stacks/stack_using_two_queues.py:46–47 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
44
return
self.main_queue.popleft()
45
46
def
peek(self) -> int | None:
47
return
self.main_queue[0]
if
self.main_queue
else
None
48
49
50
if
__name__ ==
"__main__"
:
Callers
1
stack_using_two_queues.py
File · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected