mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-31 06:33:44 +00:00
Add Doc test bubble sort (#12070)
* The string manipulation - replace() * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update replace.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updating DIRECTORY.md * Add doc test to bubble_sort * Update DIRECTORY.md * Delete strings/replace.py * Update bubble_sort.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: vijayalaxmi777 <vijayalaxmi777@users.noreply.github.com> Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
This commit is contained in:
parent
9fb51b4169
commit
c666db3729
|
@ -85,6 +85,8 @@ def bubble_sort_recursive(collection: list[Any]) -> list[Any]:
|
||||||
[1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7]
|
[1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7]
|
||||||
>>> bubble_sort_recursive([1, 3.3, 5, 7.7, 2, 4.4, 6])
|
>>> bubble_sort_recursive([1, 3.3, 5, 7.7, 2, 4.4, 6])
|
||||||
[1, 2, 3.3, 4.4, 5, 6, 7.7]
|
[1, 2, 3.3, 4.4, 5, 6, 7.7]
|
||||||
|
>>> bubble_sort_recursive(['a', 'Z', 'B', 'C', 'A', 'c'])
|
||||||
|
['A', 'B', 'C', 'Z', 'a', 'c']
|
||||||
>>> import random
|
>>> import random
|
||||||
>>> collection_arg = random.sample(range(-50, 50), 100)
|
>>> collection_arg = random.sample(range(-50, 50), 100)
|
||||||
>>> bubble_sort_recursive(collection_arg) == sorted(collection_arg)
|
>>> bubble_sort_recursive(collection_arg) == sorted(collection_arg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user