示例#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)
示例#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)
示例#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
示例#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)
示例#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
示例#6
0
文件: hashset.py 项目: rclk15/courses
 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)
示例#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)
示例#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)
示例#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
示例#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)
示例#13
0
 def __init__(self, sourceCollection=None):
     # self._heap = Array(ArrayHeap.DEFAULT_CAPACITY)
     self._heap = list()  # 这里将列表看作为一个数组
     AbstractCollection.__init__(self, sourceCollection)
示例#14
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 = -1
     self._items = Array(ArrayQueue.DEFAULT_CAPACITY)
     AbstractCollection.__init__(self, sourceCollection)
示例#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)
示例#16
0
 def __init__(self, sourceCollection):
     """Maintains a count of modifications to the list."""
     self._modCount = 0
     AbstractCollection.__init__(self, sourceCollection)
示例#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)
示例#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)
示例#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)
示例#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)
示例#23
0
 def __init__(self, sourceCollection=None):
     self._front = None
     self._rear = None
     AbstractCollection.__init__(self, sourceCollection)
示例#24
0
 def __init__(self, sourceCollection = None):
     self._vertexCount = 0
     self._edgeCount = 0
     self._vertices = {}
     AbstractCollection.__init__(self, sourceCollection)
示例#25
0
 def __init__(self, sourceCollection = None):
     """Initialize the collection."""
     AbstractCollection.__init__(self, None)
     if sourceCollection:
         for key, value in sourceCollection:
             self[key] = value
示例#26
0
 def __str__(self):
     """Returns the string representation of self."""
     return AbstractCollection.__str__(self)
示例#27
0
 def __init__(self, sourceCollection):
     """Initializes the stack at this level."""
     AbstractCollection.__init__(self, sourceCollection)
示例#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)
示例#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)
示例#31
0
 def __init__(self, sourceCollection=None):
     self._items = Array(MinArrayHeap.DEFAULT_CAPACITY)
     AbstractCollection.__init__(self, sourceCollection)
示例#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)
示例#34
0
 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)
示例#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)
示例#36
0
 def __init__(self, sourceCollection=None, profiler=None):
     self._heap = list()
     self._profiler = profiler
     AbstractCollection.__init__(self, sourceCollection)
示例#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)
示例#38
0
 def __init__(self, sourceCollection):
     """Maintains a count of modifications to the list."""
     self._modCount = 0
     AbstractCollection.__init__(self, sourceCollection)
示例#39
0
 def __str__(self):
     """Returns the string representation of self."""
     return AbstractCollection.__str__(self)
示例#40
0
 def __init__(self, sourceCollection = None):
     self._root = None
     AbstractCollection.__init__(self, sourceCollection)
示例#41
0
 def __init__(self, sourceCollection):
     """Initializes the stack at this level."""
     AbstractCollection.__init__(self, sourceCollection)