List/List.py
def _grow(self):
        """
        special module that grow array dynamically.
        :return:
        """
        # inital capacity 8.
        initial_capacity = self._capacity

        # grown capacity 2* os
        new_capacity = initial_capacity * 2
        print("Grow from", initial_capacity, "to", new_capacity, ". This is not O(1)")

        # create new list
        b = self._allocate(new_capacity)

        # copy old list to new list
        for k in range(initial_capacity):
            b[k] = self._a[k]

        # point old list to new one.
        self._a = b

        # change initial capacity.
        self._capacity = new_capacity

        special module that grow array dynamically.
        :return:
        
special module that grow array dynamically.
special module that grow array dynamically .
def _grow(self):
        initial_capacity = self._capacity
        new_capacity = initial_capacity * 2
        print("Grow from", initial_capacity, "to", new_capacity, ". This is not O(1)")
        b = self._allocate(new_capacity)
        for k in range(initial_capacity):
            b[k] = self._a[k]
        self._a = b
        self._capacity = new_capacity
def _grow ( self ) : initial_capacity = self . _capacity new_capacity = initial_capacity * 2 print ( "Grow from" , initial_capacity , "to" , new_capacity , ". This is not O(1)" ) b = self . _allocate ( new_capacity ) for k in range ( initial_capacity ) : b [ k ] = self . _a [ k ] self . _a = b self . _capacity = new_capacity
special module that grow array dynamically.
special module that grow array dynamically .
"""
        special module that grow array dynamically.
        :return:
        """ # inital capacity 8. # grown capacity 2* os # create new list # copy old list to new list # point old list to new one. # change initial capacity.
None
self