Commit Graph

17 Commits

Author SHA1 Message Date
Suyash Dongre
0e2e6abd6f
Added doctest to heap.py ()
* Added doctest to heap.py

* Update heap.py
2023-11-13 17:05:22 +06:00
Suyash Dongre
b51b833e0a
Added doctest to heap.py () 2023-10-28 21:43:20 +02:00
Christian Clauss
4c1f876567
Solving the Top k most frequent words problem using a max-heap ()
* Solving the `Top k most frequent words` problem using a max-heap

* Mentioning Python standard library solution in `Top k most frequent words` docstring

* ruff --fix .

* updating DIRECTORY.md

---------

Co-authored-by: Amos Paribocci <aparibocci@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-04-27 23:02:07 +05:30
Christian Clauss
45b3383c39
Flake8: Drop ignore of issue A003 ()
* Flake8: Drop ignore of issue A003

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-11-02 19:20:45 +01:00
Caeden Perelli-Harris
61eedc16c3
Remove useless code in doctests ()
* refactor: Fix matrix display deprecation

* refactor: Remove useless `print` and `pass` statements

* revert: Replace broken doctests

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

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

* revert: Fix failing doctests

* chore: Satisfy pre-commit

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-27 22:52:00 +02:00
Christian Clauss
b75a7c77f8
pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0 ()
* pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0

* pre-commit run --all-files
2022-07-11 10:19:52 +02:00
Christian Clauss
cecf43d648
Pyupgrade to Python 3.9 ()
* Pyupgrade to Python 3.9

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-09-07 13:37:03 +02:00
Dhruv Manilawala
6f21f76696
fix(ci): Update pre-commit hooks and apply new black ()
* fix(ci): Update pre-commit hooks and apply new black

* remove empty docstring
2021-04-26 07:46:50 +02:00
Mark Huang
207ac957ef
[mypy] Add type hints and docstrings to heap.py ()
* Add type hints and docstrings to heap.py

- Add type hints
- Add docstrings
- Add explanatory comments 
- Improve code readability
- Change to use f-string

* Fix import sorting

* fixup! Format Python code with psf/black push

* Fix static type error

* Fix failing test

* Fix type hints

* Add return annotation

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2020-12-26 08:42:37 +05:30
Christian Clauss
9b95e4f662
Pyupgrade to python3.8 ()
* Upgrade to Python 3.8 syntax

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-10-21 12:46:14 +02:00
Christian Clauss
bfcb95b297
Create codespell.yml ()
* fixup! Format Python code with psf/black push

* Create codespell.yml

* fixup! Format Python code with psf/black push
2020-01-18 13:24:33 +01:00
lanzhiwang
fc4c0f5bfd implement max heap and more pythonic ()
* implement max heap and more pythonic

* add doctests for heap
2020-01-14 12:16:11 +01:00
William Zhang
9eac17a408 psf/black code formatting () 2019-10-05 10:14:13 +05:00
Christian Clauss
47a9ea2b0b
Simplify code by dropping support for legacy Python ()
* Simplify code by dropping support for legacy Python

* sort() --> sorted()
2019-08-19 15:37:49 +02:00
Akash Ali
6f6510623c Update heap.py ()
Added comments for the better understanding of heap.
2019-03-04 16:49:36 +08:00
Yasser A
840aa6209b fix division by float issue in range heap.py 2018-11-06 17:19:51 -05:00
Alex Brown
564179a0ec increment 1 2018-10-19 07:48:28 -05:00