Skip to content

Commit

Permalink
Fix stack behaving as a queue as per course video
Browse files Browse the repository at this point in the history
  • Loading branch information
jslvtr authored Sep 30, 2024
1 parent d6241ec commit 6089fca
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ def __init__(self):
self.items = []

def push(self, e):
self.items.append(e)
self.items = [e] + self.items

def pop(self):
return self.items.pop()
return self.items.pop(0)


s = Stack()
Expand Down

0 comments on commit 6089fca

Please sign in to comment.