forked from Py-Contributors/AlgorithmsAndDataStructure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 3ff8965
authored
Update MergeSort.py (Py-Contributors#927)
Remove the self parameter from both the merge() and mergeSort() functions as they are not instance methods of the class.
Rename the arr parameter in the mergeSort() function to unsorted_list or something similar to make it more descriptive.
Add type hints to the function parameters and return values to improve code readability and maintainability.
Update the docstring of the mergeSort() function to adhere to the Python docstring conventions. Note: I assumed that the input list contains only integers. If the list can contain any type of elements, you may need to modify the code accordingly.
Signed-off-by: NIKITA PANDEY <113332472+nikitapandeyy@users.noreply.github.com>1 parent 5e2086b commit 3ff8965
1 file changed
+25
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | - | ||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
2 | 14 | | |
3 | 15 | | |
4 | 16 | | |
| |||
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | - | ||
30 | - | ||
41 | + | ||
42 | + | ||
31 | 43 | | |
32 | - | ||
33 | - | ||
34 | - | ||
35 | - | ||
36 | - | ||
44 | + | ||
45 | + | ||
37 | 46 | | |
38 | - | ||
39 | - | ||
40 | - | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
41 | 52 | | |
42 | - | ||
43 | - | ||
53 | + | ||
44 | 54 | | |
45 | - | ||
55 | + | ||
56 | + | ||
46 | 57 | | |
47 | - | ||
48 | - | ||
| |||
0 commit comments