Fixed bug in bubble_sort_recursive docstring where the doctest was calling bubble_sort_iterative([]) instead of bubble_sort_recursive([]). This was a copy-paste error that would cause the doctest to pass even if bubble_sort_recursive had issues with empty lists.
Change:
- Line 71: Changed '>>> bubble_sort_iterative([])' to '>>> bubble_sort_recursive([])'
This ensures the doctest properly validates the recursive implementation.
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Fix return type description in bubble_sort.py
Better (clearer, standard phrasing):
:return: the same collection ordered in ascending order
* Update bubble_sort.py
---------
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Use TypeError for non-string input in count_vowels
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix docstring and improve input validation in kth_lexicographic_permutation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update kth_lexicographic_permutation.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Fix incorrect doctest references in fibonacci functions
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Improve documentation for linear search algorithm
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Replace asserts with explicit validation in modular_division
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update linear_search.py
---------
Co-authored-by: Anusha-DeviE <itzanushadevi@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* docs: refine docstring and simplify reverse_letters implementation
Updated the docstring for clarity and improved the logic for reversing words.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update reverse_letters.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Use TypeError for non-string input in count_vowels
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix docstring and improve input validation in kth_lexicographic_permutation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Handle gcd(0, 0) edge case
* Update kth_lexicographic_permutation.py
* Update count_vowels.py
* Update greatest_common_divisor.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Add type hints and improve code quality for generate_parentheses_iterative
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix line length issue
* Update generate_parentheses_iterative.py
* Update generate_parentheses_iterative.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* feat: add Graham Scan convex hull algorithm
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: address pre-commit issues
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* chore: Algorithm-Keeper's comments addressed
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add Jarvis March (Gift Wrapping) convex hull algorithm
* Use descriptive parameter names per algorithms-keeper review
* Update jarvis_march.py
* Update jarvis_march.py
* fix: add pytest marker
* Update jarvis_march.py
* feat: removed doctests and created a separate test file for CI to pass
* Update jarvis_march_unit.py
* Update jarvis_march.py
* Update jarvis_march_unit.py
* feat: added test folder with tests to pass CI checks
* fix: duplicate points handled
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: fixed ruff errors
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* feat: add sliding window maximum using monotonic deque
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* feat: add sliding window maximum using monotonic deque
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix binary search with duplicates issue #13886
* Add docstrings to binary search functions
Added docstrings for lower_bound and upper_bound functions.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update searches/binary_search.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor docstrings for lower_bound and upper_bound
Updated docstring parameter and return type annotations for lower_bound and upper_bound functions.
* Update searches/binary_search.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* feat: optimizing the prune function at the apriori_algorithm.py archive
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: fixing the unsorted importing statment
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: fixing the key structure to a tuple that can be an hashable structure
* Update apriori_algorithm.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update apriori_algorithm.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Add doctest for circular queue overflow condition
Added a doctest to test the QUEUE IS FULL exception when attempting to enqueue an element into a full circular queue. This improves test coverage for line 67 in data_structures/queues/circular_queue.py.
Fixes#9943
* Update circular_queue.py
* Update circular_queue.py
* Update circular_queue.py
* Update circular_queue.py
---------
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
- Add -> None return type annotation to pi_estimator function
- Improves code clarity and follows Python type hinting best practices
- Function already had proper type hints for parameters
Co-authored-by: Gunish Mukherji <gunishmukherji@Gunishs-MacBook-Air.local>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Fix typo in spheres intersection print statement
* Fix typo in CONTRIBUTING.md
* Improve comments in comb_sort.py
* pyproject.toml: tool.ruff.target-version = "py314"
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix comment formatting in lint.ignore section
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Added t-SNE with Iris dataset example
* Added t-SNE with Iris dataset example
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated with descriptive variables
* Add descriptive variable names
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add Descriptive Variable names
* Adding Descriptive variable names
* Update machine_learning/t_stochastic_neighbour_embedding.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update machine_learning/t_stochastic_neighbour_embedding.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Improved line formatting
* Adding URL for t-SNE Wikipedia
* Apply suggestion from @cclauss
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* added rotate_array.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed issues
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed reverse issue
* added doctests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* changed k to steps for a descriptive name
* fixed non-pep
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix covid_stats_via_xpath.py
Improve error handling.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix covid_stats_via_xpath.py typo
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix ruff
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* upgrade covid_stats_via_xpath.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update and fix covid_stats_via_xpath.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>