129 Commits

Author SHA1 Message Date
mjk22071998
5be1839fc7 "Added two blank lines to sorted_linked_list.py" 2024-10-01 15:58:28 +05:00
mjk22071998
ea5c1194bc Merge branch 'master' of https://github.com/mjk22071998/Python 2024-10-01 15:57:03 +05:00
mjk22071998
fa29e39c2a "Updated type hints for Optional[Node] to Node | None in SortedLinkedList class" 2024-10-01 15:56:54 +05:00
pre-commit-ci[bot]
6838bd89ea [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 10:55:23 +00:00
mjk22071998
15026d88f8 removed trailing whitespace and formatted import section 2024-10-01 15:54:37 +05:00
pre-commit-ci[bot]
5d98fd74dc [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 10:49:40 +00:00
mjk22071998
3ab0f7e585 Corrected doctests 2024-10-01 15:49:07 +05:00
mjk22071998
36480f4c27 Merge branch 'master' of https://github.com/mjk22071998/Python 2024-10-01 15:45:34 +05:00
mjk22071998
4cb8282bd1 "Added import statement for Optional type from typing module." 2024-10-01 15:45:29 +05:00
pre-commit-ci[bot]
0847316786 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 10:44:26 +00:00
mjk22071998
53bd3be495 Merge branch 'master' of https://github.com/mjk22071998/Python 2024-10-01 15:43:52 +05:00
mjk22071998
2389245669 "Added type hints for variables in SortedLinkedList class" 2024-10-01 15:41:31 +05:00
pre-commit-ci[bot]
99baa932fc [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 10:25:59 +00:00
mjk22071998
3d9263b279 fixed typo 2024-10-01 15:25:04 +05:00
mjk22071998
8334ee6032 Fixed typo in merge function 2024-10-01 15:24:11 +05:00
pre-commit-ci[bot]
57405add11 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 10:23:08 +00:00
mjk22071998
fdbea27d41 updated merge function 2024-10-01 15:22:35 +05:00
mjk22071998
d96cc64ce7 "Updated type hints for Node and SortedLinkedList attributes to include None option" 2024-10-01 14:45:49 +05:00
mjk22071998
13600242ca Updated doctests 2024-10-01 14:42:28 +05:00
mjk22071998
cb0c3a33b6 "Fixed typo in class name in docstrings" 2024-10-01 14:34:07 +05:00
mjk22071998
5535759e99 "Fixed typo in class name 'SortedLinedList' to 'SortedLinkedList' in doctests." 2024-10-01 14:17:10 +05:00
mjk22071998
47f5c05bc7 Merge branch 'master' of https://github.com/mjk22071998/Python 2024-10-01 14:12:22 +05:00
mjk22071998
807ceada2e "Removed type hints for None in Node and SortedLinkedList classes." 2024-10-01 14:12:15 +05:00
pre-commit-ci[bot]
2a10afe217 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 09:10:41 +00:00
mjk22071998
0795e15a6c "Updated docstrings and comments in SortedLinkedList class and Node dataclass." 2024-10-01 14:10:05 +05:00
mjk22071998
3621bf39c9 Data type of data given and docstring generated for Node class constructor 2024-10-01 14:07:51 +05:00
pre-commit-ci[bot]
e89bb5c3a9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 09:05:41 +00:00
mjk22071998
eec1c3a98b Doctests added 2024-10-01 14:05:02 +05:00
mjk22071998
156392f49f return types added 2024-10-01 13:33:55 +05:00
mjk22071998
8c1d01684d format call removed 2024-10-01 13:29:22 +05:00
mjk22071998
187f4da98a Errors from ruff tests solved 2024-10-01 13:25:32 +05:00
mjk22071998
01dfb178b2 Errors from ruff tests solved 2024-10-01 13:25:18 +05:00
mjk22071998
4ae57dc896 Corrected errors in ruff test 2024-10-01 13:12:39 +05:00
pre-commit-ci[bot]
583e564987 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-01 08:03:03 +00:00
mjk22071998
0a1c71e34d Sorted linked list added 2024-10-01 12:53:22 +05:00
Maxim Smolskiy
7b88e15b1c
Enable ruff RUF007 rule (#11349)
* Enable ruff RUF005 rule

* Enable ruff RUF007 rule

* Fix

* Fix

* Fix

* Update sorts/bead_sort.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update sorts/bead_sort.py

* Revert "Update sorts/bead_sort.py"

This reverts commit b10e5632e4479c2117c8b67113b5aa6545f127aa.

* Revert "Update sorts/bead_sort.py"

This reverts commit 2c1816bf102eeec5aa39cb2f1806afb64b672d14.

* Update sorts/bead_sort.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2024-04-20 16:20:27 +02:00
Maxim Smolskiy
53b2926704
Enable ruff PGH003 rule (#11345)
* Enable ruff PGH003 rule

* Fix

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

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

* Fix

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-02 21:29:34 +02:00
pre-commit-ci[bot]
bc8df6de31
[pre-commit.ci] pre-commit autoupdate (#11322)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0)

* [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>
2024-03-13 07:52:41 +01:00
pre-commit-ci[bot]
ed8d9209da
[pre-commit.ci] pre-commit autoupdate (#11275)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.0)

* Upgrade pyproject.toml

* Revert sudoku_solver.py RUF017 Avoid quadratic list summation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2024-02-05 20:48:10 +01:00
Christian Clauss
eb17fcf8f5
Use dataclasses in circular_linked_list.py (#10884)
* Use dataclasses in circular_linked_list.py

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-24 08:45:36 -04:00
Aqib Javid Bhat
30122062b9
Add Floyd's Cycle Detection Algorithm (#10833)
* Add Floyd's Cycle Detection Algorithm

* Add tests for add_node function

* Apply suggestions from code review

* Update floyds_cycle_detection.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-23 13:56:43 -04:00
Precious C. Jacob
c92e86bd79
Add tests to data_structures/linked_list/swap_nodes.py (#10751)
* Added doctests to the swap_nodes file under linkedlist data structure

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

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

* Added doctests to the swap_nodes file under linkedlist data structure

* Added doctests to the swap_nodes file under linkedlist data structure

* Added doctests to the swap_nodes file under linkedlist data structure

* Update swap_nodes.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>
2023-10-22 01:33:49 +02:00
Christian Clauss
3f094fe49d
Ruff pandas vet (#10281)
* Python linting: Add ruff rules for Pandas-vet and Pytest-style

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-11 14:30:02 -04:00
Christian Clauss
844270c6e9
Remove backslashes from is_palindrome.py (#10169)
@SaiHarshaK Fixes https://github.com/TheAlgorithms/Python/pull/10081#discussion_r1349651289
2023-10-10 06:42:07 +13:00
Sai Harsha Kottapalli
12e8e9ca87
Add DocTests to is_palindrome.py (#10081)
* add doctest ut

* test complete

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

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

* format

* ruff update

* cover line 154

* Update data_structures/linked_list/is_palindrome.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* use dataclass

* pre-commit fix

* Fix mypy errors

* use future annotations

---------

Co-authored-by: Harsha Kottapalli <skottapalli@microsoft.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>
2023-10-09 14:06:16 +02:00
Christian Clauss
d0c54acd75
Use dataclasses in singly_linked_list.py (#9886) 2023-10-06 15:31:11 +13:00
Christian Clauss
5869fda742
print reverse: A LinkedList with a tail pointer (#9875)
* print reverse: A LinkedList with a tail pointer

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-06 10:55:13 +13:00
Tianyi Zheng
dfdd78135d
Fix mypy errors in circular_linked_list.py and swap_nodes.py (#9707)
* updating DIRECTORY.md

* Fix mypy errors in circular_linked_list.py

* Fix mypy errors in swap_nodes.py

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-04 18:05:00 +02:00
Siddhant Totade
3fd3497f15
Add Comments (#9668)
* docs : add comment in circular_linked_list.py and swap_nodes.py

* docs : improve comments

* docs : improved docs and tested on pre-commit

* docs : add comment in circular_linked_list.py and swap_nodes.py

* docs : improve comments

* docs : improved docs and tested on pre-commit

* docs : modified comments

* Update circular_linked_list.py

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

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

* docs : improved

* Update data_structures/linked_list/circular_linked_list.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/linked_list/circular_linked_list.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/linked_list/swap_nodes.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/linked_list/swap_nodes.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/linked_list/swap_nodes.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/linked_list/swap_nodes.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update requirements.txt

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/linked_list/circular_linked_list.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Apply suggestions from code review

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

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

* Update circular_linked_list.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>
2023-10-04 11:25:26 +02:00
Bama Charan Chhandogi
e798e5acde
add reverse k group linkedlist (#9323)
* add reverse k group linkedlist

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

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

* update

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

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

* update

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

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

* update

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

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

* update

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

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

* update

* Update reverse_k_group.py

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

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

* Update reverse_k_group.py

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

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

* Update reverse_k_group.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>
2023-10-02 02:19:39 +02:00