Skip to content

Commit

Permalink
Add doc test to bubble_sort
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayalaxmi777 authored Oct 14, 2024
1 parent 9f6633c commit 07fe40d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sorts/bubble_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
>>> bubble_sort_recursive([1, 3.3, 5, 7.7, 2, 4.4, 6])
[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
>>> collection_arg = random.sample(range(-50, 50), 100)
>>> bubble_sort_recursive(collection_arg) == sorted(collection_arg)
Expand Down

0 comments on commit 07fe40d

Please sign in to comment.