Beispiel #1
0
 def __init__(self, sourceCollection=None):
     """
     Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present.
     """
     self._front = self._rear = None
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #2
0
 def __init__(self, sourceCollection=None):
     # Now tracks occupied cells for rehashing if necessary.
     self._array = Array(HashSet.DEFAULT_CAPACITY)
     self._foundNode = self._priorNode = None
     self._index = -1
     self._occupiedCells = 0
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #3
0
 def __init__(self, sourceCollection):
     """Will copy items to the collection from sourceDictionary
     if it's present."""
     AbstractCollection.__init__(self)
     if sourceCollection:
         for key, value in sourceCollection:
             self[key] = value
Beispiel #4
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._root = None
     self._rightmost_node = None
     self._leftmost_node = None
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #5
0
 def __init__(self, sourceCollection):
     """Will copy items to the collection
     from sourceCollection if it's present."""
     AbstractCollection.__init__(self)
     if sourceCollection:
         for key, value in sourceCollection:
             self[key] = value
Beispiel #6
0
 def __init__(self, sourceCollection=None, inputCapacity=8):
     self._array = Array(inputCapacity)
     self._foundNode = self._priorNode = None
     self._index = -1
     #this has to be before the AbstractCol.__init__ b/c init will use self._loadedCells
     self._loadedCells = 0
     AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, source_collection=None):
     """
     (LinkedBT, Collection) -> NoneType
     Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present.
     """
     self.root = None
     AbstractCollection.__init__(self, source_collection)
Beispiel #8
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     # Initalize self._front and self._rear here
     self._items = Array(ArrayQueue.DEFAULT_CAPACITY)
     self._front = 0
     self._rear = 0
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #9
0
 def __init__(self, sourceCollection = None, capacity = None):
     if capacity == None:
         self._capacity = HashSet.DEFAULT_CAPACITY
     else:
         self._capacity = capacity
     self._items = Array(self._capacity)         # 集的条目
     self._foundNode = self._priorNode = None    # 引用要定位的节点,否则为None,引用定位的节点之前的节点,否则为None
     self._index = -1                            # 引用节点所在链的索引,否则置为-1
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #10
0
 def __init__(self, sourceCollection=None, capacity=None):
     if capacity is None:
         self._capacity = HashSet.DEFAULT_CAPACITY
     else:
         self._capacity = capacity
     self._items = Array(self._capacity)
     self._foundNode = self._priorNode = None
     self._index = -1
     AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, source_collection=None):
     self._items = Array(ArrayQueue.DEFAULT_CAPACITY)
     # 默认空队列值为0
     self._front = 0
     self._rear = 0
     AbstractCollection.__init__(self, source_collection)
     # 实例化对象时初始值, 则更改rear的值
     if source_collection != None:
         if type(source_collection) == int:
             self._rear = 0
         else:
             self._rear = len(source_collection) - 1
Beispiel #12
0
 def __init__(self, root, computer_mark, human_mark, sourceCollection=None):
     """Sets the initial state of self, which includes the
             contents of sourceCollection, if it's present."""
     self._root = root
     self.computer_mark = computer_mark
     self.human_mark = human_mark
     self.board = [
         [0, 0, 0],
         [0, 0, 0],
         [0, 0, 0],
     ]
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #13
0
 def __init__(self, sourceCollection=None):
     # self._heap = Array(ArrayHeap.DEFAULT_CAPACITY)
     self._heap = list()  # 这里将列表看作为一个数组
     AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, sourceCollection = None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._front = self._rear = -1
     self._items = Array(ArrayQueue.DEFAULT_CAPACITY)
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #15
0
 def __init__(self, sourceCollection = None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._root = None
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #16
0
 def __init__(self, sourceCollection):
     """Maintains a count of modifications to the list."""
     self._modCount = 0
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #17
0
 def __int__(self, sourceCollection = None):
     AbstractCollection.__init__(self, sourceCollection)
 def __eq__(self, other):
     """Returns True if self equals other, or False otherwise."""
     AbstractCollection.__eq__(self,other)
Beispiel #19
0
 def __init__(self, source_collection=None):
     self._edge_count = 0
     self._vertices = dict()
     AbstractCollection.__init__(self, source_collection)
 def __init__(self, sourceCollection=None):
     """初始化"""
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #21
0
    def __init__(self, sourceCollection=None):
        """Set the initial state of self, which include the
		contents of sourceCollection ,if it's present"""
        AbstractCollection.__init__(self, sourceCollection)
Beispiel #22
0
 def __init__(self, sourceCollection = None):
     self._array = Array(HashSet.DEFAULT_CAPACITY)
     self._foundNode = self._priorNode = None
     self._index = -1
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #23
0
 def __init__(self, sourceCollection=None):
     self._front = None
     self._rear = None
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #24
0
 def __init__(self, sourceCollection = None):
     self._vertexCount = 0
     self._edgeCount = 0
     self._vertices = {}
     AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, sourceCollection = None):
     """Initialize the collection."""
     AbstractCollection.__init__(self, None)
     if sourceCollection:
         for key, value in sourceCollection:
             self[key] = value
 def __str__(self):
     """Returns the string representation of self."""
     return AbstractCollection.__str__(self)
Beispiel #27
0
 def __init__(self, sourceCollection):
     """Initializes the stack at this level."""
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #28
0
    def __init__(self, sourceCollection=None):
        """Sets the initials state of self , which include the contents of sourceCollection,
		if it's present"""
        self._items = Array(ArrayStack, DEFAULT_CAAPACITY)
        AbstractCollection.__init__(self, sourceCollection)
Beispiel #29
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = ArrayHeap()
     AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, sourceCollection=None):
     self._array = Array(HashSet.DEFAULT_CAPACITY)
     self._foundNode = self._priorNode = None
     self._index = -1
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #31
0
 def __init__(self, sourceCollection=None):
     self._items = Array(MinArrayHeap.DEFAULT_CAPACITY)
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #32
0
 def __init__(self, sourceCollection=None):
     self._vertexCount = 0
     self._edgeCount = 0
     self._vertices = {}
     AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, sourceCollection = None):
     self._heap = list()
     AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, sourceDictionary = None):
     """Sets the initial state of self, which includes the
     contents of sourceDictionary, if it's present."""
     AbstractCollection.__init__(self, None)
Beispiel #35
0
    def __init__(self, soureCollection=None):
        """Set the initial state of the self,which include the 
		content of soureCollection,if it's present"""

        self._root = None
        AbstractCollection.__init__(soureCollection)
Beispiel #36
0
 def __init__(self, sourceCollection=None, profiler=None):
     self._heap = list()
     self._profiler = profiler
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #37
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the contents of
     sourceCollection if it's present."""
     return AbstractCollection.__init__(self, sourceCollection)
 def __init__(self, sourceCollection):
     """Maintains a count of modifications to the list."""
     self._modCount = 0
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #39
0
 def __str__(self):
     """Returns the string representation of self."""
     return AbstractCollection.__str__(self)
Beispiel #40
0
 def __init__(self, sourceCollection = None):
     self._root = None
     AbstractCollection.__init__(self, sourceCollection)
Beispiel #41
0
 def __init__(self, sourceCollection):
     """Initializes the stack at this level."""
     AbstractCollection.__init__(self, sourceCollection)