Added some Searching and Sorting Algorithms#413
Added some Searching and Sorting Algorithms#413dipakpawar152000 wants to merge 1 commit intoprabhupant:masterfrom
Conversation
| def merge_sort(unsorted_list): | ||
| if len(unsorted_list) <= 1: | ||
| return unsorted_list | ||
| # Find the middle point and devide it |
There was a problem hiding this comment.
this comment seems to not be indented, could you please fix it?
| @@ -0,0 +1,19 @@ | |||
| def selection_sort(input_list): | |||
|
|
|||
There was a problem hiding this comment.
you do not need this extra line here
| @@ -0,0 +1,26 @@ | |||
| def shellSort(input_list): | |||
| gap = len(input_list) // 2 | |||
There was a problem hiding this comment.
you can save len(input_list) here outside and reuse it as len(input_list)) is the same across the function right?
| @@ -0,0 +1,26 @@ | |||
| def shellSort(input_list): | |||
There was a problem hiding this comment.
from PEP8 this should be written in lower_case_with_underscores, for e.g.:
shellSort -> shell_sort or shellsort
| @@ -0,0 +1,18 @@ | |||
| def insertion_sort(InputList): | |||
There was a problem hiding this comment.
I think this project is using the convention names in lower_case_with_underscores so believe you have to fix the variable names here
| int(((float(idxn - idx0)/( values[idxn] - values[idx0])) | ||
| * ( x - values[idx0]))) | ||
|
|
||
| # Compare the value at mid point with search value |
There was a problem hiding this comment.
don't you think the comment would be better inside the function?
laysauchoa
left a comment
There was a problem hiding this comment.
nice PR, some points:
- linting can be improved
- could add some docs strings in the functions
- the README should be updated as you are creating a new folder and this folder should be under algorithm, I believe
- the variable names used in the project and the file names follow the
lower_case_with_underscore
Description
Please include a summary of the change and which issue is fixed or what question/feature you have added.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Checklist: