Commit Graph
7 Commits
Author SHA1 Message Date
changshengpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>changshengChristian Clauss
310bb4cadc Add type hints to pancake_sort function (#14745)
* Add type hints to pancake_sort function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Use modern list[int] type hint instead of deprecated typing.List

* Update pancake_sort to use Sequence and TypeVar

Refactor pancake_sort function to accept any sequence type.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Make pancake_sort generic with type parameter T

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: changsheng <changsheng0804-blip@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-08-30 19:00:32 +02:00
matkosoricandJohn Law 7f04e5cd34 contribution guidelines checks (#1787)
* spelling corrections

* review

* improved documentation, removed redundant variables, added testing

* added type hint

* camel case to snake case

* spelling fix

* review

* python --> Python # it is a brand name, not a snake

* explicit cast to int

* spaces in int list

* "!= None" to "is not None"

* Update comb_sort.py

* various spelling corrections in documentation & several variables naming conventions fix

* + char in file name

* import dependency - bug fix

Co-authored-by: John Law <johnlaw.po@gmail.com>
2020-03-04 13:40:28 +01:00
William Zhang 9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
Parth Paradkar 390feb0b23 Add doctests for sorting algorithms (#1263)
* doctests and intro docstring added

* doctests, docstrings and check for empty collection added

* Intro docstring added

* python versions reversed
2019-10-03 10:19:11 +02:00
PatOnTheBack a2236cfb97 Improve Formatting and Code Quality (#934)
* Improved Formatting of basic_maths.py

- Added docstrings.
- Improved whitespace formatting.
- Renamed functions to match snake_case.

* Improved Formatting of factorial_python.py

- Added docstrings.
- Improved whitespace formatting.
- Renamed constants to match UPPER_CASE.

* Improved Formatting of factorial_recursive.py

- Improved whitespace formatting to meet PyLint standards.

* Improved Code to Conform to PyLint

- Renamed `max` to `max_num` to avoid redefining built-in 'max' [pylint]
- Removed unnecessary parens after 'while' keyword [pylint]

* Improved Formatting of factorial_recursive.py

- Added docstrings.
- Improved whitespace formatting.
2019-07-02 09:35:43 +05:30
Mehdi ALAOUI 02c0daf9e5 Adding unit tests for sorting functions, and improving readability on some sorting algorithms (#784)
* Adding variable to fade out ambiguity

* More readability on merge sorting algorithm

* Updating merge_sort_fastest description and explaining why

* Adding tests file with imports

* Standardazing filenames and function names

* Adding test cases and test functions

* Adding test loop

* Putting 'user oriented code' inside main condition for having valid imports

* Fixing condition

* Updating tests: adding cases and todo list

* Refactoring first euler problem's first solution
2019-05-25 21:41:24 +08:00
Sichen Liu 744dd71238 Add sorts for python3 2018-03-03 21:27:05 -05:00