From eea0cdcc5e0c60e3edb258a8ea9a395071fa448b Mon Sep 17 00:00:00 2001 From: Shebin Joseph <57233844+ShebinJoseph@users.noreply.github.com> Date: Tue, 17 Mar 2020 18:41:03 +0300 Subject: [PATCH] Removed unnecessary aliasing of OneDimensionalArray (#165) --- pydatastructs/linear_data_structures/arrays.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pydatastructs/linear_data_structures/arrays.py b/pydatastructs/linear_data_structures/arrays.py index 980aab92b..454d3b94d 100644 --- a/pydatastructs/linear_data_structures/arrays.py +++ b/pydatastructs/linear_data_structures/arrays.py @@ -48,8 +48,8 @@ class OneDimensionalArray(Array): Examples ======== - >>> from pydatastructs import OneDimensionalArray as ODA - >>> arr = ODA(int, 5) + >>> from pydatastructs import OneDimensionalArray + >>> arr = OneDimensionalArray(int, 5) >>> arr.fill(6) >>> arr[0] 6 @@ -127,7 +127,6 @@ def fill(self, elem): for i in range(self._size): self._data[i] = elem -ODA = OneDimensionalArray class DynamicArray(Array): """ @@ -216,7 +215,7 @@ def _modify(self): below load factor. """ if self._num/self._size < self._load_factor: - arr_new = ODA(self._dtype, 2*self._num + 1) + arr_new = OneDimensionalArray(self._dtype, 2*self._num + 1) j = 0 for i in range(self._last_pos_filled + 1): if self[i] is not None: @@ -228,7 +227,7 @@ def _modify(self): def append(self, el): if self._last_pos_filled + 1 == self._size: - arr_new = ODA(self._dtype, 2*self._size + 1) + arr_new = OneDimensionalArray(self._dtype, 2*self._size + 1) for i in range(self._last_pos_filled + 1): arr_new[i] = self[i] arr_new[self._last_pos_filled + 1] = el