diff --git a/pydatastructs/linear_data_structures/arrays.py b/pydatastructs/linear_data_structures/arrays.py index d13bebb87..cc92c9362 100644 --- a/pydatastructs/linear_data_structures/arrays.py +++ b/pydatastructs/linear_data_structures/arrays.py @@ -63,6 +63,9 @@ class OneDimensionalArray(Array): .. [1] https://en.wikipedia.org/wiki/Array_data_structure#One-dimensional_arrays ''' + + __slots__ = ['_size', '_data', '_dtype'] + def __new__(cls, dtype=NoneType, *args, **kwargs): if dtype == NoneType or len(args) not in (1, 2): raise ValueError("1D array cannot be created due to incorrect" diff --git a/pydatastructs/miscellaneous_data_structures/stack.py b/pydatastructs/miscellaneous_data_structures/stack.py index bff1d75db..9b82ca465 100644 --- a/pydatastructs/miscellaneous_data_structures/stack.py +++ b/pydatastructs/miscellaneous_data_structures/stack.py @@ -84,6 +84,8 @@ def peek(self): class ArrayStack(Stack): + __slots__ = ['maxsize', 'top', 'items', 'dtype'] + def __new__(cls, maxsize=None, top=0, items=None, dtype=int): if not _check_type(maxsize, int): raise ValueError("maxsize is missing.") diff --git a/pydatastructs/trees/binary_trees.py b/pydatastructs/trees/binary_trees.py index 87e1b0e37..e8fb8206a 100644 --- a/pydatastructs/trees/binary_trees.py +++ b/pydatastructs/trees/binary_trees.py @@ -182,6 +182,7 @@ class BinarySearchTree(BinaryTree): pydatastructs.trees.binary_tree.BinaryTree """ + def insert(self, key, data): walk = self.root_idx if self.tree[walk].key == None: