class documentation

class DynamicArray:

View In Hierarchy

A dynamic array class akin to a simplified Python list.

Method __getitem__ Return element at index k.
Method __init__ Create an empty array.
Method __len__ Return number of elements stored in the array.
Method append Add object to end of the array.
Method insert Insert value at index k, shifting subsequent values rightward.
Method remove Remove first occurrence of value (or raise ValueError).
Method _make_array Return new array with capacity c.
Method _resize Resize internal array to capacity c.
Instance Variable _A Undocumented
Instance Variable _capacity Undocumented
Instance Variable _n Undocumented
def __getitem__(self, k):

Return element at index k.

def __init__(self):

Create an empty array.

def __len__(self):

Return number of elements stored in the array.

def append(self, obj):

Add object to end of the array.

def insert(self, k, value):

Insert value at index k, shifting subsequent values rightward.

def remove(self, value):

Remove first occurrence of value (or raise ValueError).

def _make_array(self, c):

Return new array with capacity c.

def _resize(self, c):

Resize internal array to capacity c.

_A =

Undocumented

_capacity =

Undocumented

_n: int =

Undocumented