* fixed shell sort
* udpate code style
* Update sorts/shell_sort.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Add Patience Sort
* fix code for pre-commit
* Fix params def
* Adding new line at end of file
* Remove Trailing Whitespace
* Adding space between the methods of the Stack class
* Removing Trailing Whitespace
* Ordering Imports
* Adding url patience sort
Co-authored-by: jvnascimento <nascimento783@gmail.com>
* Tighten up quicksort()
* updating DIRECTORY.md
* str does not support .pop()
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Fix all errors mentioned in pre-commit run:
- Fix end of file
- Remove trailing whitespace
- Fix files with black
- Fix imports with isort
* Fix errors
* Update sorts/quick_sort_3partition.py
Another quick sort algorithm, returns a new sorted list
* Update sorts/quick_sort_3_partition.py
rename quick_sort_3partition to quick_sort_3part
* Update sorts/quick_sort_3_partition.py
rename quick_sort_3part to three_way_radix_quicksort
Three-way radix quicksort:
https://en.wikipedia.org/wiki/Quicksort#Three-way_radix_quicksort
First divide the list into three parts.
Then recursively sort the "less than" and "greater than" partitions.
* Update sorts/quick_sort_3_partition.py
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Delete sleep_sort.py
A silly algorithm designed to waste time. #2350 demonstrates that it is a 20+ second denial of service attack on every Travis CI run that we do.
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add merge insertion sort
* Fix python naming conventions
* Add wikipedia link
* Add type hint
* Fix python to python3
Co-authored-by: Christian Clauss <cclauss@me.com>
* Refactor doubled process in if-condition into one outside of if-condition
Co-authored-by: Christian Clauss <cclauss@me.com>
* Refactor make python3 prior to python
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fix name of is_surplus into has_last_odd_item
* Add comment
* Fix long comment to shorten
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added bead sort
* Commit suggestion
* Added checking before sort
* Bead sort only works for sequences of nonegative integers
Co-authored-by: Christian Clauss <cclauss@me.com>
* 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>
* Added more flexibility to functions, decreased amount of repeating code
* Added docstrings
* Updated input functions
* Added doctests
* removed test piece of code
* black .
* Updated caesar cipher standard alphabet to fit python 3.8
* Update and rename sleepsort.py to sleep_sort.py
* Or 4
Co-authored-by: Christian Clauss <cclauss@me.com>
* added sleepsort
Adding sleepsort
* Add doctest and typing for sleepsort
* Use self-descriptive variable name
* Update sleepsort.py
* Update sorts/sleepsort.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* autoblack: actions/checkout@v1 # Use v1, NOT v2
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* 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>