@@ -12,45 +12,51 @@ Quick Start Guide
12
12
# import the required sort
13
13
from pygorithm.sorting import bubble_sort
14
14
15
- myList = [12 , 4 , 2 , 14 , 3 , 7 , 5 ]
15
+ my_list = [12 , 4 , 2 , 14 , 3 , 7 , 5 ]
16
16
17
- # to sort the list
18
- sorted_list = bubble_sort.sort(myList )
17
+ # to sort the _list
18
+ sorted__list = bubble_sort.sort(my_list )
19
19
20
20
Features
21
21
--------
22
22
23
- * Sorts available:
24
- - Bubble Sort (bubble_sort)
25
- - Selection Sort (selection_sort)
26
- - Insertion Sort (insertion_sort)
27
- - Merge Sort (merge_sort)
28
- - Quick Sort (quick_sort)
29
- - Bucket Sort (bucket_sort)
30
- - Counting Sort (counting_sort)
31
- - Heap Sort (heap_sort)
32
- - Shell Sort (shell_sort)
33
-
34
- * To see all the available functions in a module there is a `modules() ` function available. For example,
23
+ * To see all the available functions in a module, you can just type ``help() `` with the module name as argument. For example,
35
24
36
25
.. code :: python
37
26
38
- >> > from pygorithm.sorting import modules
39
- >> > modules.modules()
40
- [' bubble_sort' , ' bucket_sort' , ' counting_sort' , ' heap_sort' , ' insertion_sort' , ' merge_sort' , ' quick_sort' , ' selection_sort' , ' shell_sort' ]
27
+ >> > from pygorithm import sorting
28
+ >> > help (sorting)
29
+ Help on package pygorithm.sorting in pygorithm:
30
+
31
+ NAME
32
+ pygorithm.sorting - Collection of sorting methods
33
+
34
+ PACKAGE CONTENTS
35
+ bubble_sort
36
+ bucket_sort
37
+ counting_sort
38
+ heap_sort
39
+ insertion_sort
40
+ merge_sort
41
+ modules
42
+ quick_sort
43
+ selection_sort
44
+ shell_sort
45
+ >> > from pygorithm.sorting import bubble_sort
46
+ >> > help (bubble_sort)
41
47
42
48
* For sorting:
43
- Remember ``sort() `` function takes its parameter as a list only.
49
+ Remember ``sort() `` function takes its parameter as a _list only.
44
50
45
51
.. code-block :: python
46
52
47
53
# import the required sort
48
54
from pygorithm.sorting import bubble_sort
49
55
50
- myList = [12 , 4 , 2 , 14 , 3 , 7 , 5 ]
56
+ my_list = [12 , 4 , 2 , 14 , 3 , 7 , 5 ]
51
57
52
- # to sort the list
53
- sorted_list = bubble_sort.sort(myList )
58
+ # to sort the _list
59
+ sorted__list = bubble_sort.sort(my_list )
54
60
55
61
* Get time complexities of all the sorting algorithms
56
62
@@ -76,9 +82,9 @@ Bubble Sort
76
82
77
83
* Functions and their uses
78
84
79
- .. function :: bubble_sort.sort(List )
85
+ .. function :: bubble_sort.sort(_list )
80
86
81
- - **List ** : `list ` or `array ` to be sorted
87
+ - **_list ** : `list ` or `array ` to be sorted
82
88
- **Return Value ** : returns the sorted `list `
83
89
84
90
.. function :: bubble_sort.time_complexities()
@@ -91,19 +97,19 @@ Bubble Sort
91
97
92
98
* For improved Bubble sort
93
99
94
- .. function :: bubble_sort.improved_sort(List )
100
+ .. function :: bubble_sort.improved_sort(_list )
95
101
96
- - **List ** : `list ` or `array ` to be sorted
102
+ - **_list ** : `list ` or `array ` to be sorted
97
103
- **Return Value ** : returns the sorted `list `
98
104
99
105
Bucket Sort
100
106
-----------
101
107
102
108
* Functions and their uses
103
109
104
- .. function :: bucket_sort.sort(List , bucketSize)
110
+ .. function :: bucket_sort.sort(_list , bucketSize)
105
111
106
- - **List ** : `list ` or `array ` to be sorted
112
+ - **_list ** : `list ` or `array ` to be sorted
107
113
- **bucketSize ** : size of the bucket. Default is **5 **
108
114
- **Return Value ** : returns the sorted `list `
109
115
@@ -120,9 +126,9 @@ Counting Sort
120
126
121
127
* Functions and their uses
122
128
123
- .. function :: counting_sort.sort(List )
129
+ .. function :: counting_sort.sort(_list )
124
130
125
- - **List ** : `list ` or `array ` to be sorted
131
+ - **_list ** : `list ` or `array ` to be sorted
126
132
- **Return Value ** : returns the sorted `list `
127
133
128
134
.. function :: counting_sort.time_complexities()
@@ -138,9 +144,9 @@ Heap Sort
138
144
139
145
* Functions and their uses
140
146
141
- .. function :: heap_sort.sort(List )
147
+ .. function :: heap_sort.sort(_list )
142
148
143
- - **List ** : `list ` or `array ` to be sorted
149
+ - **_list ** : `list ` or `array ` to be sorted
144
150
- **Return Value ** : returns the sorted `list `
145
151
146
152
.. function :: heap_sort.time_complexities()
@@ -156,9 +162,9 @@ Insertion Sort
156
162
157
163
* Functions and their uses
158
164
159
- .. function :: insertion_sort.sort(List )
165
+ .. function :: insertion_sort.sort(_list )
160
166
161
- - **List ** : `list ` or `array ` to be sorted
167
+ - **_list ** : `list ` or `array ` to be sorted
162
168
- **Return Value ** : returns the sorted `list `
163
169
164
170
.. function :: insertion_sort.time_complexities()
@@ -174,9 +180,9 @@ Merge Sort
174
180
175
181
* Functions and their uses
176
182
177
- .. function :: merge_sort.sort(List )
183
+ .. function :: merge_sort.sort(_list )
178
184
179
- - **List ** : `list ` or `array ` to be sorted
185
+ - **_list ** : `list ` or `array ` to be sorted
180
186
- **Return Value ** : returns the sorted `list `
181
187
182
188
.. function :: merge_sort.time_complexities()
@@ -192,9 +198,9 @@ Quick Sort
192
198
193
199
* Functions and their uses
194
200
195
- .. function :: quick_sort.sort(List )
201
+ .. function :: quick_sort.sort(_list )
196
202
197
- - **List ** : `list ` or `array ` to be sorted
203
+ - **_list ** : `list ` or `array ` to be sorted
198
204
- **Return Value ** : returns the sorted `list `
199
205
200
206
.. function :: quick_sort.time_complexities()
@@ -210,9 +216,9 @@ Selection Sort
210
216
211
217
* Functions and their uses
212
218
213
- .. function :: selection_sort.sort(List )
219
+ .. function :: selection_sort.sort(_list )
214
220
215
- - **List ** : `list ` or `array ` to be sorted
221
+ - **_list ** : `list ` or `array ` to be sorted
216
222
- **Return Value ** : returns the sorted `list `
217
223
218
224
.. function :: selection_sort.time_complexities()
@@ -228,9 +234,9 @@ Shell Sort
228
234
229
235
* Functions and their uses
230
236
231
- .. function :: shell_sort.sort(List )
237
+ .. function :: shell_sort.sort(_list )
232
238
233
- - **List ** : `list ` or `array ` to be sorted
239
+ - **_list ** : `list ` or `array ` to be sorted
234
240
- **Return Value ** : returns the sorted `list `
235
241
236
242
.. function :: shell_sort.time_complexities()
0 commit comments