class documentation

class ArrayStack:

View In Hierarchy

LIFO Stack implementation using a Python list as underlying storage.

Method __init__ Create an empty stack.
Method __len__ Return the number of elements in the stack.
Method is_empty Return True if the stack is empty.
Method pop Remove and return the element from the top of the stack (i.e., LIFO).
Method push Add element e to the top of the stack.
Method top Return (but do not remove) the element at the top of the stack.
Instance Variable _data Undocumented
def __init__(self):

Create an empty stack.

def __len__(self):

Return the number of elements in the stack.

def is_empty(self):

Return True if the stack is empty.

def pop(self):

Remove and return the element from the top of the stack (i.e., LIFO).

Raise Empty exception if the stack is empty.

def push(self, e):

Add element e to the top of the stack.

def top(self):

Return (but do not remove) the element at the top of the stack.

Raise Empty exception if the stack is empty.

_data: list =

Undocumented