mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
de2725f4ac
* 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> |
||
---|---|---|
.github | ||
arithmetic_analysis | ||
backtracking | ||
bit_manipulation | ||
blockchain | ||
boolean_algebra | ||
cellular_automata | ||
ciphers | ||
compression | ||
computer_vision | ||
conversions | ||
data_structures | ||
digital_image_processing | ||
divide_and_conquer | ||
dynamic_programming | ||
file_transfer | ||
fuzzy_logic | ||
genetic_algorithm | ||
geodesy | ||
graphics | ||
graphs | ||
greedy_method | ||
hashes | ||
images | ||
linear_algebra | ||
machine_learning | ||
maths | ||
matrix | ||
networking_flow | ||
neural_network | ||
other | ||
project_euler | ||
quantum | ||
scheduling | ||
scripts | ||
searches | ||
sorts | ||
strings | ||
traversals | ||
web_programming | ||
.coveragerc | ||
.gitignore | ||
.gitpod.yml | ||
.pre-commit-config.yaml | ||
.travis.yml | ||
CONTRIBUTING.md | ||
DIRECTORY.md | ||
LICENSE.md | ||
pytest.ini | ||
README.md | ||
requirements.txt | ||
Travis_CI_tests_are_failing.md |
The Algorithms - Python
All algorithms implemented in Python (for education)
These implementations are for learning purposes only. Therefore they may be less efficient than the implementations in the Python standard library.
Contribution Guidelines
Read our Contribution Guidelines before you contribute.
Community Channel
We're on Gitter! Please join us.
List of Algorithms
See our directory.