codezonediitj / pydatastructs

A python package for data structures and algorithms
https://pydatastructs.readthedocs.io/en/stable/
Other
199 stars 270 forks source link

Implemented Introsort #549

Closed Kishan-Ved closed 6 months ago

Kishan-Ved commented 6 months ago

References to other Issues or PRs or Relevant literature

Fixes https://github.com/codezonediitj/pydatastructs/issues/545

Brief description of what is fixed or changed

Implemented Introsort.

codecov[bot] commented 6 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (1942891) 97.601% compared to head (13d4dfe) 97.552%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #549 +/- ## ============================================= - Coverage 97.601% 97.552% -0.050% ============================================= Files 34 34 Lines 4295 4331 +36 ============================================= + Hits 4192 4225 +33 - Misses 103 106 +3 ``` | [Files](https://app.codecov.io/gh/codezonediitj/pydatastructs/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codezonediitj) | Coverage Δ | | |---|---|---| | [pydatastructs/linear\_data\_structures/\_\_init\_\_.py](https://app.codecov.io/gh/codezonediitj/pydatastructs/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codezonediitj#diff-cHlkYXRhc3RydWN0cy9saW5lYXJfZGF0YV9zdHJ1Y3R1cmVzL19faW5pdF9fLnB5) | `100.000% <ø> (ø)` | | | [pydatastructs/linear\_data\_structures/algorithms.py](https://app.codecov.io/gh/codezonediitj/pydatastructs/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codezonediitj#diff-cHlkYXRhc3RydWN0cy9saW5lYXJfZGF0YV9zdHJ1Y3R1cmVzL2FsZ29yaXRobXMucHk=) | `99.215% <91.666%> (-0.574%)` | :arrow_down: | [![Impacted file tree graph](https://app.codecov.io/gh/codezonediitj/pydatastructs/pull/549/graphs/tree.svg?width=650&height=150&src=pr&token=mZMqq5ubAu&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codezonediitj)](https://app.codecov.io/gh/codezonediitj/pydatastructs/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codezonediitj)
Kishan-Ved commented 6 months ago

I've done the mentioned changes: Added comment to code that a custom compactor cannot be taken due to heapsort's limitation. I've also removed the commented statement of import stack.

Kishan-Ved commented 6 months ago

1 check didn't pass, I believe this is due to some backend issue.

=========================== short test summary info ============================
FAILED pydatastructs/utils/tests/test_code_quality.py::test_backend_argument_message - AssertionError: assert '<function intro_sort at 0x7f97b968adc0>' in 'As of 1.0.1-dev version, only Python backend is supported for <function next_permutation at 0x7f97b968a940> API'
 +  where '<function intro_sort at 0x7f97b968adc0>' = str(<function intro_sort at 0x7f97b968adc0>)
======= 1 failed, 160 passed, 2 xfailed, 7 xpassed in 138.76s (0:02:18) ========
Kishan-Ved commented 6 months ago

All checks pass, the code suggested had next_permutation by mistake, which I changed to my function: intro_sort

Kishan-Ved commented 6 months ago

Thank you for your help! @czgdp1807 This is one of my first prominent open source code contributions! This helped me learn about reading, understanding and managing a large codebase. I'm delighted and eager to contribute more to this organization :)

Also please check the issue I faced, which I've mentioned here: https://github.com/codezonediitj/pydatastructs/issues/547 , along with the solution.