Python/divide_and_conquer
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
..
__init__.py Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
closest_pair_of_points.py Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
convex_hull.py Fix long line, tests (#2123) 2020-06-16 14:29:13 +02:00
heaps_algorithm_iterative.py Heaps algorithm iterative (#2505) 2020-09-29 12:38:12 +02:00
heaps_algorithm.py Heaps algorithm (#2475) 2020-09-29 12:39:07 +02:00
inversions.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
max_subarray_sum.py Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
mergesort.py Update mergesort.py (#2563) 2020-10-15 14:00:12 +05:30
power.py Added Strassen divide and conquer algorithm to multiply matrices. (#1648) 2020-01-12 09:34:10 +05:30
strassen_matrix_multiplication.py from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00