Commit Graph

6 Commits

Author SHA1 Message Date
Christian Clauss
cecf43d648
Pyupgrade to Python 3.9 (#4718)
* Pyupgrade to Python 3.9

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-09-07 13:37:03 +02:00
Akash G Krishnan
de2725f4ac
Update mergesort.py (#2563)
* Update mergesort.py

1) Updating the merge sort in python as the previous implementation was modifying the input array
2) divided the division part and conquer part of the merge sort algorithm as 2 functions namely mergeSort and merge.
3) function mergeSort divides the function into halves i.e the purpose of the function will be to divide the array
4) function merge will merge 2 halves into a sorted array
5)Added random test cases using shuffle as suggested by @dhruvmanila
6 The time and space complexity of the previous and my version remains the same. i.e (n log(n) time and n log(n) space
7) changed variables as per the python case as required and suggested by @dhruvmanila
8) Updated function names as suggested by @dhurvmanila

* Update mergesort.py

Added in few more test cases 
added type hints for the functions and parameters as suggested by @dhruvmanila
formatted the code using Auto Pep8

* Update mergesort.py

update and added new testcases

* Update mergesort.py

Added in doc test in merge function

* Update mergesort.py

fixing pre-commit fails

* Update mergesort.py

Co-authored-by: Dhruv <dhruvmanila@gmail.com>
2020-10-15 14:00:12 +05:30
Ekansh Mangal
025b1a6989
Merge sort Update variable names (#2032)
* Update Merge sort variable names

* Update mergesort.py

* Update mergesort.py

* black

* Update mergesort.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-05-24 08:38:43 +02:00
Christian Clauss
1f8a21d727
Tighten up psf/black and flake8 (#2024)
* Tighten up psf/black and flake8

* Fix some tests

* Fix some E741

* Fix some E741

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-05-22 08:10:11 +02:00
Ankur Chattopadhyay
7592cba417 psf/black code formatting (#1421)
* added sol3.py for problem_20

* added sol4.py for problem_06

* ran `black .` on `\Python`
2019-10-22 19:13:48 +02:00
Jigyasa G
b6cc37d461 mergesort added (#1313)
* mergesort added

* added doctest
2019-10-10 00:12:09 +05:00