Skip to content

Instantly share code, notes, and snippets.

@Kimxons
Last active March 20, 2021 09:20
Show Gist options
  • Save Kimxons/dd343363e074915dab2399bc11df57b2 to your computer and use it in GitHub Desktop.
Save Kimxons/dd343363e074915dab2399bc11df57b2 to your computer and use it in GitHub Desktop.

Revisions

  1. Kimxons revised this gist Mar 20, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions stack.py
    Original file line number Diff line number Diff line change
    @@ -3,15 +3,14 @@
    stack.append(7)
    print("Stack after appending: \n", stack)
    stack.pop()
    print("Stack after poping: \n", stack)
    print("Stack after popping: \n", stack)

    #implementation two
    class Stack:
    def __init__(self):
    self.stack = []
    def isEmpty(self):
    return len(self.stack) == 0
    p=AutoPairsDelete()
    def push(self,p):
    self.stack.append(p)
    def pop(self):
  2. Kimxons revised this gist Mar 20, 2021. No changes.
  3. Kimxons created this gist Mar 20, 2021.
    18 changes: 18 additions & 0 deletions stack.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #implementation one
    stack = [2,3,4]
    stack.append(7)
    print("Stack after appending: \n", stack)
    stack.pop()
    print("Stack after poping: \n", stack)

    #implementation two
    class Stack:
    def __init__(self):
    self.stack = []
    def isEmpty(self):
    return len(self.stack) == 0
    p=AutoPairsDelete()
    def push(self,p):
    self.stack.append(p)
    def pop(self):
    return self.stack.pop()