コード例 #1
0
ファイル: linkedqueue.py プロジェクト: Vadum-cmd/lab_13
 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
ファイル: abstractdict.py プロジェクト: QaziPython/CS-Books
 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
ファイル: linkedbst.py プロジェクト: misha2956/lab13_z12
 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
ファイル: abstractdict.py プロジェクト: deepcapsule/Python
 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)
コード例 #7
0
 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)
コード例 #11
0
 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)
コード例 #18
0
 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)
コード例 #20
0
 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
ファイル: hashset.py プロジェクト: QaziPython/CS-Books
 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
ファイル: graph.py プロジェクト: staufferl16/Programming112
 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
ファイル: abstractstack.py プロジェクト: Nobody592/MazeSolver
 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)
コード例 #30
0
 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)
コード例 #33
0
 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
ファイル: arrayheap.py プロジェクト: hieugomeister/ASU
 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
ファイル: linkedbst.py プロジェクト: TechInTech/dataStructure
 def __init__(self, sourceCollection = None):
     self._root = None
     AbstractCollection.__init__(self, sourceCollection)
コード例 #41
0
ファイル: abstractstack.py プロジェクト: lokesh1729/myPython
 def __init__(self, sourceCollection):
     """Initializes the stack at this level."""
     AbstractCollection.__init__(self, sourceCollection)