コード例 #1
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the contents of sourceCollection, if it's present."""
     self._items = Array(ArrayBag.DEFAULT_CAPACITY)
     AbstractBag.__init__(self, sourceCollection)
     if sourceCollection:
         for item in sourceCollection:
             self.add(item)
コード例 #2
0
ファイル: treesortedbag.py プロジェクト: hieugomeister/ASU
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = LinkedBST()
     AbstractBag.__init__(self, sourceCollection)
     if not self._items.isBalanced():
         self._items.rebalance()
コード例 #3
0
ファイル: linkedbagsub.py プロジェクト: rclk15/courses
 def __init__(self, sourceCollection = None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present.
     **Items will be in reverse order of sourceCollection!
     """
     if AbstractBag.TRACE:
         print("linkedbag's __init__")
     self._items = None
     AbstractBag.__init__(self, sourceCollection) #calls init of parent class
コード例 #4
0
ファイル: linkedbag.py プロジェクト: zach-king/PyDSA
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = None
     AbstractBag.__init__(self, sourceCollection)
コード例 #5
0
 def __init__(self, sourceCollection=None):
     self._items = None
     AbstractBag.__init__(self, sourceCollection)
コード例 #6
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = Array(ArrayBag.DEFAULT_CAPACITY)
     self._targetIndex = -1
     AbstractBag.__init__(self, sourceCollection)
コード例 #7
0
 def __init__(self, sourceCollection = None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = Array(ArrayBag.DEFAULT_CAPACITY)
     AbstractBag.__init__(self, sourceCollection)
コード例 #8
0
ファイル: arraybag.py プロジェクト: frnorth/Python
 def __init__(self, sourceCollection=None):
     AbstractArray.__init__(self)
     AbstractBag.__init__(self, sourceCollection)
コード例 #9
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = None
     AbstractBag.__init__(self, sourceCollection)
コード例 #10
0
ファイル: arraybag.py プロジェクト: TechInTech/dataStructure
 def __int__(self, sourceCollection = None):
     self._items = Array(Arraybag.DEFAULT_CAPACITY)
     AbstractBag.__init__(self, sourceCollection)
コード例 #11
0
 def __init__(self, sourceCollection=None):
     """初始化"""
     self._items = Array(ArrayBag.DEFALUT_SIZE)
     AbstractBag.__init__(self, sourceCollection)