Skip to content

Commit 99cd580

Browse files
committed
updated docs and imports related to shell_sort and radix_sort
1 parent 7c7d209 commit 99cd580

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

docs/source/pydatastructs/linear_data_structures/algorithms.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,8 @@ Algorithms
4545

4646
.. autofunction:: pydatastructs.jump_search
4747

48-
.. autofunction:: pydatastructs.intro_sort
48+
.. autofunction:: pydatastructs.intro_sort
49+
50+
.. autofunction:: pydatastructs.shell_sort
51+
52+
.. autofunction:: pydatastructs.radix_sort

pydatastructs/linear_data_structures/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
jump_search,
4848
selection_sort,
4949
insertion_sort,
50-
intro_sort
50+
intro_sort,
51+
shell_sort,
52+
radix_sort
5153
)
5254
__all__.extend(algorithms.__all__)

pydatastructs/linear_data_structures/algorithms.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
'jump_search',
3131
'selection_sort',
3232
'insertion_sort',
33-
'intro_sort'
33+
'intro_sort',
34+
'shell_sort',
35+
'radix_sort'
3436
]
3537

3638
def _merge(array, sl, el, sr, er, end, comp):
@@ -1904,9 +1906,6 @@ def shell_sort(array, **kwargs):
19041906
19051907
.. [1] https://en.wikipedia.org/wiki/Shellsort
19061908
"""
1907-
backend = kwargs.pop("backend", Backend.PYTHON)
1908-
if backend == Backend.CPP:
1909-
return _algorithms.shell_sort(array, **kwargs)
19101909
start = kwargs.get('start', 0)
19111910
end = kwargs.get('end', len(array) - 1)
19121911
comp = kwargs.get('comp', lambda u, v: u <= v)
@@ -1976,9 +1975,6 @@ def radix_sort(array, **kwargs):
19761975
19771976
.. [1] https://en.wikipedia.org/wiki/Radix_sort
19781977
"""
1979-
backend = kwargs.pop("backend", Backend.PYTHON)
1980-
if backend == Backend.CPP:
1981-
return _algorithms.radix_sort(array, **kwargs)
19821978
start = int(kwargs.get('start', 0))
19831979
end = int(kwargs.get('end', len(array) - 1))
19841980

pydatastructs/linear_data_structures/tests/test_algorithms.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
cocktail_shaker_sort, quick_sort, longest_common_subsequence, is_ordered,
66
upper_bound, lower_bound, longest_increasing_subsequence, next_permutation,
77
prev_permutation, bubble_sort, linear_search, binary_search, jump_search,
8-
selection_sort, insertion_sort, intro_sort, Backend)
8+
selection_sort, insertion_sort, intro_sort, shell_sort, radix_sort, Backend)
99

10-
from pydatastructs.linear_data_structures.algorithms import shell_sort, radix_sort
1110
from pydatastructs.utils.raises_util import raises
1211
import random, pytest
1312

0 commit comments

Comments
 (0)