530 Commits
Author SHA1 Message Date
Christian Clauss 3dae007c74 More ruff rules ANN for type annotations (#15443) 2026-09-26 17:27:43 +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
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
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
Nimish Srivastavapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
8478904252 Added gas_station.py (#11822)
* Added gas_station.py

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

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

* Update gas_station.py

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

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

* Update gas_station.py

changes done

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

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

* Update gas_station.py

* Update gas_station.py

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

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

* Update gas_station.py

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

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

* Update gas_station.py

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

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

* Update gas_station.py

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

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

* updating DIRECTORY.md

* Refactor gas station circuit solution with NamedTuple

* Clarify gas_stations argument description

Updated the argument description for gas_stations to clarify the attributes.

---------

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 13:43:13 +02:00
KavyadharshiniM06pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
01f73f8066 Add two-pointer method for finding triplets with 0 sum (#14186)
* Add two-pointer method for finding triplets with 0 sum

Implemented a new function to find unique triplets in an array that sum to zero using the two-pointer technique.

* [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-22 05:32:24 +02:00
Khushi TyagiandChristian Clauss d9027b0346 ty: un-ignore invalid-type-arguments (#15392)
* ty: un-ignore invalid-type-arguments

* Refactor Comparable protocol and improve docstrings

Removed unused __lt__ method from Comparable protocol and updated docstrings for clarity.

* Remove unused total_ordering import

Removed unused import of total_ordering from functools.

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-21 18:27:24 +02:00
Faizan HabibChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
d2296a4596 Add comprehensive doctests to disjoint_set.py (#13619)
* Add comprehensive doctests to disjoint_set.py

- Add doctests for make_set() function with basic initialization tests
- Add doctests for union_set() function with union operations and connected nodes
- Add doctests for find_set() function with path compression verification
- Add doctests for find_python_set() function with error handling
- Add doctests for test_disjoint_set() function with comprehensive example
- All doctests pass and follow project coding standards
- Improves test coverage for fundamental disjoint set data structure

Contributes to #9943

* from dataclasses import dataclass

* [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-21 17:52:19 +02:00
cbd4566953 Added postfix_to_infix_conversion.py (#10607)
* Added postfix_to_infix_conversion.py

* Added wikipedia link in postfix_to_infix_conversion.py

* updating DIRECTORY.md

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-21 17:38:57 +02:00
Mukesh Singh NegiandChristian Clauss 4dcbd94e50 added iterative solution for product sum problem (#11133)
* added iterative solution for product sum problem

Signed-off-by: negi153 <mukesh7758negi@gmail.com>

* added benchmark and improved time

Signed-off-by: mukeshsingh.negi@infosys.com <mukesh7758negi@gmail.com>

* updated variable names and doc string

Signed-off-by: mukeshsingh.negi@infosys.com <mukesh7758negi@gmail.com>

* updated doctest

---------

Signed-off-by: negi153 <mukesh7758negi@gmail.com>
Signed-off-by: mukeshsingh.negi@infosys.com <mukesh7758negi@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-21 16:34:24 +02:00
024e90d731 add monotonic queue algorithm (#10531)
* add monotonic queue algorithm

* add monotonic queue algorithm

* add monotonic queue algorithm

* monotonic queue

* updating DIRECTORY.md

* Rename file to correct directory structure

* updating DIRECTORY.md

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-21 16:27:39 +02:00
7cc80db1f6 Added pairwise iteration algorithms (#9645)
* Adds pairwise iteration algorithm

* Fixed code typo

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Improve documentation for pairwise_iteration_tee

Updated documentation to clarify the use of pairwise iteration and added a reference to the itertools.pairwise function.

* Correct import and update pairwise test cases

Fix import statement for pairwise in pairwise_iteration_tee function and update test cases.

* Fix indentation in pairwise_iteration.py docstring

* Enhance docstring for pairwise iteration

Added docstring explaining the use of itertools.tee for independent iterators.

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-21 12:35:37 +02:00
SARATHI-78SARATHI-78Christian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1c2181944c Add evil_number algorithm in maths/special_numbers (#15388)
* Add evil_number algorithm in maths/special_numbers

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

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

---------

Co-authored-by: SARATHI-78 <sundarasarathi78@gmail.com>
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-21 11:46:50 +02:00
AnupamBahlandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 6748dc3325 Stack implementation that tracks Min/Max element (#9946)
* A stack implementation that tracks min/max element in constant time

* Adding more comments

* Ruff changes

* Fixing doctests

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

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

* Annotating Stack

* Adding more tests

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-21 08:41:38 +02:00
aryandgandhi b006e4c4c6 Remove nth node from end of list (#9880)
* removed nth node

* added link to learn about algo

* Addressed PR feedback

* update bot comments

* update type

* new branch

* new branch

* latest updates with typing

* latest updates with typing
2026-09-21 08:38:32 +02:00
Shyam baghelpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
a381578994 Add edge cases for equilibrium index (#15372)
* Add edge cases for equilibrium index

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

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

* Refactor docstring in equilibrium_index_in_array.py

Updated docstring examples and formatting for clarity.

---------

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-18 00:59:23 +02:00
Dharshini_RSChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
aa38af81c9 fix:bucket count type (#15063)
* fix:bucket count type

* fixed TypeError

* Refine docstring and adjust return statement

Updated docstring for partition_liked_list method to clarify behavior. Changed return statement from None to None for consistency.

* Add script to map open PRs to modified files

This script lists all open pull requests in the current directory's git repository and maps each file touched by any open PR to its corresponding PR numbers. It outputs the results in GitHub-flavored Markdown format.

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

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

* Add noqa comments for subprocess calls

Add noqa comments to suppress specific linting warnings.

---------

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-13 09:25:21 +02:00
Inesh Agarwalpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
bde91502db Add XOR Linked List implementation with doctests (#13699)
* Add XOR Linked List implementation with doctests

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

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

* Add XOR Linked List implementation with doctests

* Add XOR Linked List implementation with doctests

* Add XOR Linked List implementation with doctests

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

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

* updating DIRECTORY.md

* Refine docstring and variable comment in XOR linked list

Updated docstring for clarity and corrected 'ids' to 'IDs'.

* Refactor Node class to use dataclass

Refactor Node class to use dataclass for cleaner syntax.

* [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-13 08:27:13 +02:00
Martin Oywa 0051e4eae2 Add partition_list in linked_list (#13325) 2026-09-13 08:12:23 +02:00
Martin Oywa b59e85983f Add find kth_element_from_end in linked_lists (#13322)
* Add find kth_element_from_end in linked-lists

* Update kth_element_from_end docstring

* Update kth_element_from_end k to position
2026-09-13 08:10:38 +02:00
priya-sundaram-dev 945b5ab9ee data_structures: add return type annotations (ANN201) (#15306)
Annotate the unambiguous, primitive/container-returning public methods
flagged by ruff ANN201 across data_structures/ (int/bool/float/list/dict
and one fluent self-return). Reduces ANN201 in this directory from 58 to 36.

Element-typed and sentinel-union returns (e.g. node .data getters,
dict|False in the Sudoku solver) are intentionally left for follow-up,
since they warrant generics/TypeVar or a type checker rather than a guess.

Refs #15296
2026-09-13 00:10:48 +02:00
Christian Clauss 0525ef5da8 ruff rule ANN202 missing-return-type-private-function (#15298)
* ruff rule ANN202 missing-return-type-private-function

* ruff rule ANN202 missing-return-type-private-function
2026-09-12 21:47:08 +02:00
Christian Clauss 0da45b148a ruff rule ANN204 missing-return-type-special-method (#15300) 2026-09-12 21:35:04 +02:00
Christian Claussandcclauss 7bd1e983c3 ruff rules RET for return statements (#15301)
* updating DIRECTORY.md

* ruff rules RET for return statements

---------

Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-12 21:33:52 +02:00
Christian Clauss 201c2fbed9 Add data_structures/linked_list/sorted_linked_list.py 2026-09-11 15:16:11 +02:00
Christian Clauss 37d41a773b Use dataclasses, use iter to remove print function
Refactor Node class to use dataclass for attributes and update iter_linked_list to yield node data. Remove print_linked_list function and update merge function to use direct comparison.
2026-09-11 10:55:32 +02:00
Hardik Pawar 9215334b42 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar 7a569ce0f8 Fix doctests 2026-09-11 10:55:32 +02:00
Hardik Pawar d2eae4d707 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar 49fdd2e847 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar 2a7f02f561 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar 98dc827aa9 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar 5c847f358d Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar 29223066d2 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar c2a419ea47 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar 010e902251 Fix type hint 2026-09-11 10:55:32 +02:00
Hardik Pawar 93675b67f7 Add return type hint 2026-09-11 10:55:32 +02:00
Hardik Pawar e5f92c73c1 Fix 2026-09-11 10:55:32 +02:00
Hardik Pawar e45663018c Fix comments 2026-09-11 10:55:32 +02:00
Hardik Pawar 21dfa5ad9f Add Merge Sort Linked List algorithm 2026-09-11 10:55:32 +02:00
1227haranandChristian Clauss 4a766c632c Add test cases to balanced_parentheses.py (#11870)
* Updated test cases

* Apply suggestion from @cclauss

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-11 08:12:40 +02:00
Antonio GurgelandChristian Clauss 499d398bf0 Fix treap priorities (#14775)
Docstring says "more priority", but `<` operator causes lesser
priorities to sort to the top.

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-11 07:52:18 +02:00
Maitri UpadhyayandChristian Clauss 3d11d0ca8a fix: correct treap split() comparison to match docstring behavior (#14762)
* fix: correct treap split() to match docstring for equal values (#7854)

The split() function in treap.py uses `<` comparison but the docstring states that the right subtree should contain values "greater or equal" to the split value. This fix changes `elif value < root.value:` to `elif value <= root.value:` so that equal values go to the right subtree as documented.

Fixes #7854

* Fix typo in Treap node docstringfix: remove accidental typo in Node class docstring

* Fix erase logic in treap.py

Adjust split logic to include the value in the right subtree.

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-11 07:07:16 +02:00
Roushan Kumar SinghRoushan Singhpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
1d83421a4d Fixes The Bug In Radix Tree. Issue #11316 (#11385)
* Fixes The Bug In Radix Tree. Issue #11316

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

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

* Added Ruff Recommendations

Based on ruff Recommendations
    - Removed WhiteSpaces
    - Moved the Import to beginning
    - Replaced assertTrue with regular assert

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

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

* Ruff Fixes :  E501 Line too long

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

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

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

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

* Ruff Fixes :  E501 Line too long

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

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

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

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

* Fixes Ruff Error

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

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

* Ruff All Fixes

* Improve comments in radix_tree.py

Refactor comments for clarity and correctness in radix_tree.py.

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

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

* Add test function for RadixNode operations

Added a test function for the RadixNode class to validate insertion, search, and deletion of words.

---------

Co-authored-by: Roushan Singh <procoder9973@gmail.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-10 13:17:24 +02:00
priya-sundaram-dev faa6b36863 Add splay tree (self-adjusting BST) (#15266)
* Add splay tree (self-adjusting BST)

Implements a splay tree with insert, search and delete, each of which
splays the accessed node to the root for amortized O(log n) access and
locality of reference. Includes full type hints and doctests.

Closes #13760

* Make Node a dataclass and add repr doctest (review feedback)
2026-09-10 10:57:47 +02:00
Christian Claussandcclauss 3725b917aa pre-commit: Add zizmor and replace prettier with rumdl (#15236)
* pre-commit: Add zizmor and replace prettier with rumdl

* updating DIRECTORY.md

---------

Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-09 09:55:19 +01:00
BHUMIKA KADU✨kadubhumikapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
636dd57af7 Fix ty invalid assignment (#15222)
* Fix ty invalid assignment diagnostics

* updating DIRECTORY.md

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

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

* Fix unused typing import

* Fix gradient accumulation type handling

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

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

* Fix automatic differentiation gradient dtype handling

---------

Co-authored-by: kadubhumika <kadubhumika@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-08 17:57:46 +02:00