4194 Commits
Author SHA1 Message Date
Nikhil_Tumma 7f81fcd68c fix: make bubble sort work with comparable items (#15448) 2026-09-27 15:10:21 +02:00
github-actions[bot]andcclauss 3f0532a7b1 chore: refresh Hacktoberfest 2026 prep tracker (#15446)
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-27 14:50:29 +02:00
Milad KhoshdelandChristian Clauss 03b07352eb test: add failing doctests for introsort heap fallback range boundaries (#15445)
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-27 14:49:49 +02:00
Milad Khoshdel a7a298e417 Fix introsort heap fallback ignoring range boundaries (#15435)
* fix: restrict introsort heap fallback to the active range

* test: cover introsort heap fallback range boundaries

* fix: sort introsort heap fallback ranges without copying

* test: cover introsort heap sort range boundaries and default end
2026-09-27 14:46:23 +02:00
priya-sundaram-devpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
78e489f5dd CI: Upgrade to free-threaded Python 3.15t (#15105)
* ci: try Python 3.15 release candidate (DRAFT)

Point the repo's .python-version at 3.15 so every workflow that reads
python-version-file runs on the 3.15 release candidate (allow-prereleases
is already enabled across all workflows). Add the 3.15 trove classifier
and bump scipy>=1.18.1, which is the first scipy with cp315 manylinux
wheels, so uv installs it as a wheel rather than building from source.

Rebuilt on current master: the earlier version of this PR edited the
per-workflow `python-version: 3.14` lines, but master has since moved
the interpreter to a single `.python-version` file, so the change is now
a one-line switch there.

Purpose is to document which dependencies/tests are not yet 3.15-ready.
Must stay DRAFT until Python 3.15 GA (early October). Requested in #15081.

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

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

* Upgrade to Python 3.15t

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-26 18:06:56 +02:00
github-actions[bot]andcclauss 56009287a1 chore: refresh Hacktoberfest 2026 prep tracker (#15442)
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-26 17:32:21 +02:00
Christian Clauss 3dae007c74 More ruff rules ANN for type annotations (#15443) 2026-09-26 17:27:43 +02:00
KratosandChristian Clauss f59bddb055 fix(sorts): make smoothsort generic over Comparable items (#15441)
* fix(sorts): make smoothsort generic over Comparable items

* The TypeVar is no longer needed.

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-26 10:13:40 +02:00
github-actions[bot]andcclauss 25252556c6 chore: refresh Hacktoberfest 2026 prep tracker (#15437)
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-25 17:14:13 +02:00
Soham Sharad Patilpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
b3233c9f49 Clarify bitwise operations used in addition without arithmetic (#14059)
* Document addition function using bitwise operations

Added docstring explaining the bitwise addition method.

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

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

* Refactor addition function documentation and output

Updated docstring to clarify the use of bitwise operations for addition. Modified the output format of the result to include both input values.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-25 07:05:17 +02:00
Seeman Gpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
7a8079f4cd Improve documentation and educational comments in find_max.py (#13017)
* Improve documentation and educational comments in find_max.py

- Added clear explanation of Divide and Conquer approach
- Improved parameter descriptions for better understanding  
- Enhanced comments to explain the algorithm steps
- Better documentation for educational purposes

* [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: Christian Clauss <cclauss@me.com>
2026-09-25 04:35:51 +02:00
gokul krishnanpriya-sundaram-devpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
4b9a0692a6 added merge interval problem on the array data structure (#14009)
* added merge interval problem on the array ds

* removed typing which is  deprecated

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

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

* Refactor type hints in merge_intervals function

Updated type hints from List to built-in list for compatibility.

* Enhance merge_intervals function documentation

Added edge cases handling and updated complexity notes.

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

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

* Refactor docstring and type hints in merge_intervals

Updated type hints and docstring formatting in merge_intervals function.

* Refactor merge_intervals function docstring

Updated docstring formatting and improved error message clarity.

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

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

* Update data_structures/arrays/merge_intervals.py

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-25 03:56:06 +02:00
e49caf57d0 types(reverse_selection): constrain items to Comparable (#15410)
* types(reverse_selection): constrain items to Comparable

Bind reverse_selection_sort's element type to a Comparable Protocol so the
signature says "a list of items that can be compared with each other"
instead of a bare list, and keep the element type in the return.

reverse_subarray only swaps elements and never compares them, so its
TypeVar stays unbounded.

Also adds doctests for a comparable non-int type (strings, floats) and for
the failure mode: mixing non-comparable items must raise TypeError rather
than silently mis-sort. The test battery picks the sort up for the shared
cases and for the rejection check.

* updating DIRECTORY.md

---------

Co-authored-by: AuroraAeon <auroraeon@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 22:09:11 +02:00
ModusensusandChristian Clauss 1d64d4cda6 sorts: make quick_sort_3_partition generic over Comparable items (#15431)
* sorts: make quick_sort_3_partition generic over Comparable items

* sorts: rebase quick_sort_3_partition generic change onto upstream rewrite

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 22:03:33 +02:00
UTSAV SINGHALpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
82e0cf39af feat(arrays): Add in-place array reversal algorithm (#13370)
* feat(arrays): Add in-place array reversal algorithm

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

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

* Enhance docstring for reverse_array function

Updated docstring to clarify that the function returns the reversed list.

* Clarify return value in reverse_array function

Updated docstring to clarify that the function returns the reversed list. Modified example usage to display the reversed array correctly.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 22:00:55 +02:00
Suhani Kundupriya-sundaram-devpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
100bf9a427 Created set_matrix_zeroes.py (#13369)
* Created set_matrix_zeroes.py

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

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

* Update data_structures/arrays/set_matrix_zeroes.py

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 21:44:21 +02:00
8b11aeae4d Add Merge Sorted Arrays Algorithm with Type Hints and Doctests (#13589)
* Add merge sorted array algorithm

* updating DIRECTORY.md

* Validate input arrays for sorting in merge function

Add validation to check if input arrays are sorted.

* Correct error message assignment in merge_sorted_arrays

Fix variable assignment for error message in merge_sorted_arrays function.

* Fix sorted check for input arrays in merge function

---------

Co-authored-by: JainRamyak <JainRamyak@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 19:35:22 +02:00
b3f113dc4b types: constrain tim sort items to Comparable (#15432)
Co-authored-by: TayfurYldz <238304586+TayfurYldz@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 16:26:56 +02:00
Ramvelivelapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
18c82c9d60 Bitonic sort comparable (#15428)
* Make bitonic sort support comparable items

* Add comparable item tests for bitonic sort

* [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: Christian Clauss <cclauss@me.com>
2026-09-24 16:16:10 +02:00
Fayupable d961217d5f sorts: type patience_sort's Stack for any comparable item (#15427)
Part of #15234.
2026-09-24 16:08:14 +02:00
Fayupable c41bc04f33 sorts: type unknown_sort's merge_sort for any comparable item (#15426)
Part of #15234.
2026-09-24 16:05:09 +02:00
a1fb42f058 types(iterative_merge_sort): constrain items to Comparable (#15413)
Bind merge and iter_merge_sort's element type to a Comparable Protocol so
the signatures say "a list of items that can be compared with each other"
instead of a bare list, and keep the element type in the return. result is
annotated list[T] so the generic survives the local binding.

iter_merge_sort was already in the shared SORTS battery but was missing from
test_sort_rejects_non_comparable_items, so its checklist box was only half
done; this completes it.

Also adds a doctest for the failure mode: mixing non-comparable items must
raise TypeError rather than silently mis-sort. The 'cba' doctest becomes
list('cba') so it matches the list[T] signature now on the function -- the
runtime behaviour is unchanged, since iter_merge_sort copies its input with
list() either way.

Co-authored-by: AuroraAeon <auroraeon@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 16:02:45 +02:00
ModusensusandChristian Clauss 16fd0d5519 sorts: make merge_insertion_sort generic over Comparable items (#15417)
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 15:58:39 +02:00
FelixandChristian Clauss c4d6a2a3c3 sorts: type intro sort for comparable items (#15403)
* Refactor sorting functions to use generics

* test: cover intro sort comparable items

* Placate ruff rule PT007

* test: include intro sort in shared sort suite

* Update test_sorts.py

* Delete tests/test_intro_sort.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 15:55:56 +02:00
65b1482203 Add similarity test for square matrices (#13022)
* Add similarity test for square matrices

* Fix naming convention: MatrixLike to matrix_like

* Use TypeAlias for proper mypy type checking

* Fix CI errors: use type keyword and fix line length

* Fix docstring formatting in similar_matrices.py

Corrected formatting and punctuation in docstring.

* updating DIRECTORY.md

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 15:02:05 +02:00
Sarbatorepre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
1619583e69 feat(hashes): add Jenkins-One-At-A-Time function (#14560)
* Add joaat function for non-cryptographic hashing

Implement the Jenkins-One-At-A-Time hash function.

* Add doctest for joaat function

Added doctest examples for the joaat function and included a main block to run tests.

* Refactor joaat function variable names for prevent shadowing

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

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

* Rename function to jenkins_one_at_a_time

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 14:53:19 +02:00
Milad Khoshdelanddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 185ef19b17 Simplify implementation (#14654)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-24 14:21:50 +02:00
ANDI FAUZAN HEDIANTOROandChristian Clauss b995597167 fix(maths): use specific exception types in collatz_sequence (#14769)
Replace generic Exception with TypeError for non-integer inputs and ValueError for non-positive integers. Split the combined validation check into two separate checks for clearer error reporting. This follows Python best practices for exception handling.

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 14:20:29 +02:00
github-actions[bot]andcclauss ac86c330e0 chore: refresh Hacktoberfest 2026 prep tracker (#15430)
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 14:11:17 +02:00
ANDI FAUZAN HEDIANTOROandChristian Clauss 026c307820 fix(maths): correct recursive call in sum_of_digits_recursion (#14768)
sum_of_digits_recursion() was calling sum_of_digits() (the iterative version) instead of itself in the recursive case. This meant the function was not actually recursive as its name suggests.

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 14:10:44 +02:00
Christian Claussandcclauss eb3776a015 Delete neural_network/gan.py_tf (#15423)
* Delete neural_network/gan.py_tf

* updating DIRECTORY.md

---------

Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 12:39:47 +01:00
Shashank Tyagipre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
bc1f8a8bb2 Adding LSTM algorithm from scratch in neural network algorithm sections (#12082)
* added lstm algorithm in neural network section.

* commented the testing lines of code

* modified code to meet contribution.md file guidelines

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

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

* Add LSTM algorithm implementation in neural network section

* shorten the individual lines

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

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

* shorten the lines

* Refactor LSTM input data initialization

* Refactor LSTM network implementation and improve code readability

* changed code a bit for meet ruff standards

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

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

* Refactor LSTM class to improve code readability and maintainability

* Refactor tqdm import in LSTM class

* Refactor tqdm import in LSTM class

* added doc tests

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

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

* descriptive names + improved doctests

* Refactor LSTM class: Increase training epochs to 100

* Refactor LSTM class: Improve test method and add comments

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

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

* added doct tests for each function

* added type hints in lstm init

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

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

* fixed type hints which were repeating in code

* written doc tests for backward pass and forward pass, fixed variable names in sigmoid function from x to input array

* fixed return type of test function to str from none

* Refactor LSTM implementation and clean up code

Removed author information and unused print statements. Updated parameter names in docstrings for consistency.

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

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

* Rename stm_model to lstm_model in lstm.py

* Fix parameter name in sigmoid and tanh methods

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 11:57:28 +02:00
Thrivepre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
ba2d8ef44e Refactor error handling and improve logging (#13000)
* Refactor error handling and improve logging

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

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

* httpx --> httpx2

* updating DIRECTORY.md

* Replace httpx with httpx2 for HTTP requests

* [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: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 09:18:56 +02:00
github-actions[bot]andcclauss feceadf5c0 chore: refresh Hacktoberfest 2026 prep tracker (#15421)
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 05:13:29 +02:00
Jaya PradeepandChristian Clauss 2b20de1d45 feat: add longest repeating subsequence algorithm (#14856)
Add a dynamic programming implementation of the Longest Repeating Subsequence (LRS) algorithm. This finds the longest subsequence that occurs at least twice in a string, using a variation of LCS where the string is compared with itself but characters at the same index cannot be reused. Includes comprehensive doctests and type hints.

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 05:08:55 +02:00
Kaviya N SandChristian Clauss 48aeff88fd Add is_palindrome_ignore_case_and_spaces to strings/palindrome.py (#14907)
* Add is_palindrome_ignore_case_and_spaces to strings/palindrome.py

* Address review: handle punctuation, add dedicated test data for new function

* Revert unrelated benchmark timing comments per review

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-24 05:02:49 +02:00
priya-sundaram-dev f0ab75d0d2 Remove tensorflow/keras files and the keras dependency (#15420)
Per discussion in #15418, these four files are not algorithms (they are
how-to-use scripts wrapping a deep-learning framework) and dragged in the
heavy keras/tensorflow dependency stack:

- computer_vision/cnn_classification.py
- dynamic_programming/k_means_clustering_tensorflow.py
- machine_learning/lstm/lstm_prediction.py
- neural_network/input_data.py (TF MNIST data loader; nothing imports it)

Also removes the now-orphaned machine_learning/lstm/ package (only
__init__.py + sample_data.csv, which served lstm_prediction.py).

Cleanups:
- Drop keras from pyproject.toml dependencies; regenerate uv.lock
  (removes absl-py, h5py, keras, ml-dtypes, namex, optree).
- Remove the pre-release libhdf5-dev install step from build.yml and
  sphinx.yml (it existed only because keras needs hdf5).
- Drop the four stale pytest --ignore entries in build.yml.
- Remove the four DIRECTORY.md entries and the empty Lstm heading.
2026-09-24 04:45:23 +02:00
lighting9999pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
c4246f0ea0 Optimize Ford-Fulkerson algorithm with type annotations and performance improvements (#13128)
* change ford_fulkerson.py

* fix ford_fulkerson.py

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

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

* fix typo for ford_fulkerson.py

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

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

* Change ford_fulkerson.py

* fix I001 Error for ford_fulkerson.py

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

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

* fix ford_fulkerson.py

* [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: Christian Clauss <cclauss@me.com>
2026-09-23 23:43:40 +02:00
a3806f7d80 Add XOR-based swap algorithm for two numbers (#13018)
* Add XOR-based swap algorithm for two numbers

* updating DIRECTORY.md

* Include additional test case for xor_swap function

Add example for xor_swap with larger integers

---------

Co-authored-by: Balamurugan315 <balamuruganmsde@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 23:39:11 +02:00
Deepak JainI529010Deepak14JainDeepak Jainpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
ff206e632c Transitive Closure Algorithm (#12940)
* Added transitive closure with tests

* updating DIRECTORY.md

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

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

* fix lint issue

* lint fix

* fix line_to_long issue

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

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

* define return type

* added type hint

* fix line_too_long lint error

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

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

* fix line_too_long

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

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

* Refactor transitive closure function for clarity

Updated parameter and return type annotations for clarity. Modified variable names for consistency and corrected comments.

* Refine docstring for transitive_closure function

Updated the docstring to improve clarity and fix grammar.

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

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

---------

Co-authored-by: I529010 <deepak.jain04@sap.com>
Co-authored-by: Deepak14Jain <Deepak14Jain@users.noreply.github.com>
Co-authored-by: Deepak Jain <93066547+Deepak14Jain@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-23 22:38:22 +02:00
Priyanshu Mishrapriya-sundaram-devpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>John LawpoyeaChristian Clausscclauss
c3984d3f19 Added Random Forest Regressor as an additional prediction model. (#12767)
* Added Random Forest Regressor as an additional prediction model.

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

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

* Added Random Forest Regressor to main voting

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

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

* Update run.py

* Update run.py

* Update run.py

Used matplotlib to plot actual vs predicted user count, forecast confidence intervals, outlier thresholds from IQR.
Added logging instead of print because in production, print() is not scalable.

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

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

* Update run.py

* Update run.py

* updating DIRECTORY.md

* Apply suggestion from @cclauss

* updating DIRECTORY.md

* updating DIRECTORY.md

* Apply batched suggestions from code review

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>

---------

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: poyea <poyea@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>
2026-09-23 21:45:28 +02:00
c27e95123c feat: create get_ordinary_annuity_future_value function in financial (#12358)
* feat: create get_ordinary_annuity_future_value

* Rename function to ordinary_annuity_future_value

* updating DIRECTORY.md

* updating DIRECTORY.md

---------

Co-authored-by: Jeonghyun Min <20122791@tafe.wa.edu.au>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 18:27:33 +02:00
793a5f79c4 feat: create (financial) get_annuity_due_future_value function (#12357)
* feat: create get_annuity_due_future_value function

* docs: modify docstring for introduction

* Rename function to annuity_due_future_value

* updating DIRECTORY.md

* updating DIRECTORY.md

---------

Co-authored-by: Jeonghyun Min <20122791@tafe.wa.edu.au>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 17:49:17 +02:00
IsidroChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
ac6de03a92 Add Hoare partition algorithm (#12601)
* Add Hoare partition algorithm

This is another variant of in-place quicksort apart from 'Lomuto' and the 'Dutch National Flag algorithm'

* Refactor quick_sort_3_partition.py for clarity

Refactor import statement and improve docstrings for clarity.

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

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

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-23 17:16:28 +02:00
Yashwanth Adimulamyashwanth-adimulampre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
6dfe637e31 Implementing Dynamic array (#12271)
* Adding dynamic array implementation

* Adding references

* updating DIRECTORY.md

* Trying to solve pre-commit error of type overload

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

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

* Increasing test for dynamic_array.py

---------

Co-authored-by: yashwanth-adimulam <yashwanth-adimulam@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-23 16:23:09 +02:00
Putul Singhpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
42a73547fa Persistent Segment Tree (#12186)
* Suffix Array and LCP Array Implementation

* Delete divide_and_conquer/suffix_array_lcp.py

* Add files via upload

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Update persistent_segment_tree.py

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

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

* Refactor Node class to use dataclass

Refactor Node class to use dataclass for cleaner syntax. Update PersistentSegmentTree methods to maintain functionality with the new Node structure.

* updating DIRECTORY.md

* Refactor PersistentSegmentTree implementation

* Refactor Node initialization and update methods

Refactor Node class to properly initialize value and improve type hints. Update PersistentSegmentTree methods for better clarity and maintainability.

* Apply suggestion from @cclauss

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

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

* Update persistent_segment_tree.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 16:16:13 +02:00
Tarun Vishwakarmapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
61611418a4 Added edmonds_blossom_algorithm.py. For maximum matching in the graph. #12043 (#12056)
* Added edmonds_blossom_algorithm.py. For maximum matching in the graph.

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

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

* Added test for edmonds_blossom_algorithm.py in graph/tests/

Resolved the blossom data naming issue.

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

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

* resolved pre commit checks for test_edmonds_blossom_algorithm.py and edmonds_blossom_algorithm.py

* Changes in the main file and test file as test were failing due to stuck in an infinite loop.

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

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

* Resolved Pre commit errors

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

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

* Resolved per commit checks and unresolved conversations

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

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

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 16:10:55 +02:00
wistrasypre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
7cf493ed70 Min Window Substring (#12133)
* Added an algorithm to the strings sub folder which finds the smallest substring of a given string which contains all of the characters in another given string.

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

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

* Formatting Fixes

* Fixed a spelling issue

* Fixed incorrect function name in test cases

* Fixed incorrect function name in test cases

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

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

* Added link to leetcode.

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 15:48:40 +02:00
Pritam Daspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
692d38ff6f shortened the lines (#12214)
* Create README.md

* Update README.md

* Add files via upload

* Delete llm_experiments directory

* Create README.md

* Add files via upload

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

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

* Add files via upload

* Delete neural_network/chatbot/main.py

* Delete neural_network/chatbot/llm_service.py

* Delete neural_network/chatbot/chatbot.py

* Delete neural_network/chatbot/db.py

* Update README.md

* Add files via upload

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

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

* Add files via upload

made changes suggested by auto-checker

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

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

* Add files via upload

* Add files via upload

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

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

* Delete neural_network/chatbot directory

* Add files via upload

* Add files via upload

* Add files via upload

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

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

* Add files via upload

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

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

* updating DIRECTORY.md

* Rename batch_size variable to _batch_size

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 15:46:57 +02:00
c0fd8deab2 Add Jacobsthal numbers to maths/special_numbers (#15409)
Co-authored-by: Rakesh4440 <rakeshvarmaks999@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-23 14:53:42 +02:00