Skip to content

Commit b14754f

Browse files
committed
Updated Sorting.rst
1 parent f187111 commit b14754f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

docs/Sorting.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ Quick Start Guide
1010

1111
.. code-block:: python
1212
13+
# import the required sort
1314
from pygorithm.sorting import bubble_sort
1415
15-
# This will print the code for bubble sort
16-
print(bubble_sort.get_code())
17-
1816
myList = [12, 4, 2, 14, 3, 7, 5]
1917
2018
# to sort the list
@@ -31,6 +29,19 @@ Features
3129
- Merge Sort (merge_sort)
3230
- Quick Sort (quick_sort)
3331

32+
* For sorting:
33+
Remember sort() function takes its parameter as a list only.
34+
35+
.. code-block:: python
36+
37+
# import the required sort
38+
from pygorithm.sorting import bubble_sort
39+
40+
myList = [12, 4, 2, 14, 3, 7, 5]
41+
42+
# to sort the list
43+
sorted_list = bubble_sort.sort(myList)
44+
3445
* Get time complexities of all the sorting algorithms
3546

3647
.. code-block:: python

0 commit comments

Comments
 (0)